<?php
// Change directory
-@chdir("../..");
+@chdir('../..');
// Set testing mode (no starter.php will be loaded!)
define('TEST_MODE', true);
// Load config file
-require(dirname(dirname(dirname(__FILE__))) . "/inc/config.php");
+require(dirname(dirname(dirname(__FILE__))) . '/inc/config.php');
// Load all include files
require($cfg->readConfig('base_path') . 'inc/includes.php');
// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
// jetzt die Personalliste wiederherstellen
-try {
- $personell = SimulatorPersonell::createSimulatorPersonellByID('SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98');
-} catch (InvalidIDFormatException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidArrayCountException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (NullPointerException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (NoObjectException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (MissingMethodException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (FileIsEmptyException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (FilePointerNotOpenedException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidArrayCountException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidMD5ChecksumException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidDataLengthException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidSimulatorIDException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (MismatchingCompressorsException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (ContainerItemIsNullException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (ContainerItemIsNoArrayException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (ContainerMaybeDamagedException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-}
+$personell = SimulatorPersonell::createSimulatorPersonellByID('SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98');
// Personal-Objekt debuggen
if (defined('DEBUG_PERSONELL_OBJ')) {
// Random price
$price = mt_rand(5, 12) * 10000;
- // Give it a try...
- try {
- // Generate command for adding objects to a price list
- $eval = sprintf("\$merchant->addItemToPriceList(%s::create%s(%s), %d);",
- $key,
- $key,
- $item,
- $price
- );
-
- // Debug message
- if ((defined('DEBUG_EVAL')) || (defined('DEBUG_ALL'))) DebugMiddleware::getInstance()->output(sprintf("[Main:] Konstruierte PHP-Anweisung: <pre><em>%s</em></pre><br />\n",
- htmlentities($eval)
- ));
-
- // Run the constructed command
- eval($eval);
- } catch (ItemNotTradeableException $e) {
- die(sprintf("[Main:] Die Preisliste des Händlers <span class=\"exception_reason\">%s</span> kann nicht befüllt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $merchant->getMerchantName(),
- $e->getMessage()
- ));
- }
+ // Generate command for adding objects to a price list
+ $eval = sprintf("\$merchant->addItemToPriceList(%s::create%s(%s), %d);",
+ $key,
+ $key,
+ $item,
+ $price
+ );
+
+ // Debug message
+ if ((defined('DEBUG_EVAL')) || (defined('DEBUG_ALL'))) DebugMiddleware::getInstance()->output(sprintf("[Main:] Konstruierte PHP-Anweisung: <pre><em>%s</em></pre><br />\n",
+ htmlentities($eval)
+ ));
+
+ // Run the constructed command
+ eval($eval);
}
// Haendler-Objekt debuggen
$shipping = ShippingCompany::createShippingCompany("Hanseatic Travel Company", $harbor);
// Firmenschef setzen
-try {
- $shipping->setCompanyFounder(CompanyEmployee::createCompanyEmployee("Roland", "Häder", "M", 1977, 9, 26, true, 2000));
-} catch (BirthdayInvalidException $e) {
- die(sprintf("[Main:] Reederei-Gründer konnte nicht gesetzt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-}
+$shipping->setCompanyFounder(CompanyEmployee::createCompanyEmployee("Roland", "Häder", "M", 1977, 9, 26, true, 2000));
// Dann mal ausgeben...
DebugMiddleware::getInstance()->output(sprintf("Die Reederei <span class=\"exception_reason\">%s</span> ist von <strong>%s %s</strong> gegründet worden.<br />\n",
));
// Die Reederei stellt Personal ein und bedient sich an der $personell-Instanz
-try {
- $shipping->recruitRandomEmployees(10, $personell);
-} catch (ToMuchEmployeesException $e) {
- die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte kein Personal einstellen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-} catch (OutOfBoundsException $e) {
- die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte kein Personal einstellen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-}
+$shipping->recruitRandomEmployees(10, $personell);
// Anzahl Personal ausgeben
DebugMiddleware::getInstance()->output(sprintf("Die Reederei <span class=\"exception_reason\">%s</span> hat nun <strong>%d</strong> weitere Mitarbeiter.<br />\n",
$shipping->createShipyardInHarbor("Werft 3", $harbor);
// In alle Werften sollen Passagierschiffe gebaut werden koennen
-try {
- $shipping->addShipTypeToAllShipyards("PassengerShip");
-} catch (ClassNotFoundException $e) {
- die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> kann ihre Werften nicht beschäftigen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-} catch (ClassMismatchException $e) {
- die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> kann ihre Werften nicht beschäftigen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-} catch (NoObjectException $e) {
- die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> kann ihre Werften nicht beschäftigen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-}
+$shipping->addShipTypeToAllShipyards("PassengerShip");
// Personal auf die Werften verteilen
-try {
- $shipping->distributeAllPersonellOnShipyards();
-} catch (NoShipyardsConstructedException $e) {
- die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte kein Personal den Werften zuteilen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-} catch (ClassMismatchException $e) {
- die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte kein Personal den Werften zuteilen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-} catch (NullPointerException $e) {
- die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte kein Personal den Werften zuteilen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-} catch (NoObjectException $e) {
- die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte kein Personal den Werften zuteilen. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-}
+$shipping->distributeAllPersonellOnShipyards();
// Normale Meldung ausgeben
DebugMiddleware::getInstance()->output(sprintf("Die Reederei <span class=\"exception_reason\">%s</span> beschäftigt nun ihre <strong>%d</strong> Mitarbeiter in <strong>%d</strong> Werft(en):<br />\n",
// Dann nimmt die Reederei ihren ersten Bauauftrag entgegen.
// Sie muss auch sich selber Bauauftraege erteilen!
-try {
- $shipping->addNewWorksContract(WorksContract::createWorksContract("PassengerShip", "M/S Poseidon", $shipping));
-} catch (ClassNotFoundException $e) {
- die(sprintf("[Main:] Der Bauauftrag konnte nicht erstellt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (NullPointerException $e) {
- die(sprintf("[Main:] Der Bauauftrag konnte nicht erstellt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (NoObjectException $e) {
- die(sprintf("[Main:] Der Bauauftrag konnte nicht erstellt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (MissingMethodException $e) {
- die(sprintf("[Main:] Der Bauauftrag konnte nicht erstellt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (EmptyStructuresListException $e) {
- die(sprintf("[Main:] Der Bauauftrag konnte nicht erstellt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-}
+$shipping->addNewWorksContract(WorksContract::createWorksContract("PassengerShip", "M/S Poseidon", $shipping));
// Auftrag-Instanz holen
$contract = $shipping->getLastContractInstance();
// Die Reederei hat einen Haendler gewaehlt
-try {
- $shipping->setMerchantInstance($merchant);
-} catch (NullPointerException $e) {
- die(sprintf("[Main:] Der Händler <span class=\"exception_reason\">%s</span> konnte nicht ausgewählt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $merchant->getMerchantName(),
- $e->getMessage()
- ));
-} catch (NoObjectException $e) {
- die(sprintf("[Main:] Der Händler <span class=\"exception_reason\">%s</span> konnte nicht ausgewählt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $merchant->getMerchantName(),
- $e->getMessage()
- ));
-} catch (ClassMismatchException $e) {
- die(sprintf("[Main:] Der Händler <span class=\"exception_reason\">%s</span> konnte nicht ausgewählt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $merchant->getMerchantName(),
- $e->getMessage()
- ));
-}
+$shipping->setMerchantInstance($merchant);
// Den Bauauftrag mit der Reederei abgleichen, ob sie den Schiffstyp bauen koennen
-try {
- $typeValid = $shipping->validateWorksContractShipType($contract);
-} catch (NullPointerException $e) {
- die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte den Bauauftrag nicht validieren. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-} catch (NoObjectException $e) {
- die(sprintf("[Main:] Die Reederei <span class=\"exception_reason\">%s</span> konnte den Bauauftrag nicht validieren. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-}
+$typeValid = $shipping->validateWorksContractShipType($contract);
// Kann gebaut werden?
if ($typeValid) {
// Dann den Bauauftrag verfeinern
foreach ($einbauten['parts'] as $key=>$part) {
- try {
- $contract->addContractDetails($key, $einbauten['builds'][$key], $part);
- } catch (ShipPartNotConstructableException $e) {
- // Output message
- die($e->getMessage());
- } catch (ShipNotConstructedException $e) {
- // Output message
- die($e->getMessage());
- } catch (ItemNotInPriceListException $e) {
- die(sprintf("[Main:] Der Artikel <span class=\"exception_reason\">%s</span> konnte nicht in der Preisliste gefunden werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $key,
- $e->getMessage()
- ));
- } catch (InvalidArrayCountException $e) {
- die(sprintf("[Main:] Der Artikel <span class=\"exception_reason\">%s</span> konnte nicht in der Preisliste gefunden werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $key,
- $e->getMessage()
- ));
- }
+ $contract->addContractDetails($key, $einbauten['builds'][$key], $part);
}
// Reederei-Objekt ausgeben
unset($typeValid);
// Gesamtwert ausgeben
-try {
- $totalValue = $contract->getTotalPrice();
-} catch (NullPointerException $e) {
- die(sprintf("[Main:] Gesamtbestellwert nicht ermittelbar. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (NoObjectException $e) {
- die(sprintf("[Main:] Gesamtbestellwert nicht ermittelbar. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (MissingMethodException $e) {
- die(sprintf("[Main:] Gesamtbestellwert nicht ermittelbar. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (EmptyStructuresListException $e) {
- die(sprintf("[Main:] Gesamtbestellwert nicht ermittelbar. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (TotalPriceNotCalculatedException $e) {
- die(sprintf("[Main:] Gesamtbestellwert nicht ermittelbar. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-}
+$totalValue = $contract->getTotalPrice();
// Wert ausgeben
DebugMiddleware::getInstance()->output(sprintf("Der Bau der <span class=\"exception_reason\">%s</span> wird der Reederei <span class=\"exception_reason\">%s</span> voraussichtlich <span class=\"exception_reason\">%s</span> kosten.<br />\n",
unset($totalValue);
// Den Bauvertrag unterschreiben (damit wird er in den Bau-Queue aufgenommen)
-try {
- $shipping->signContract($contract, $shipping);
-} catch (NullPointerException $e) {
- die(sprintf("[Main:] The shipping company <span class=\"exception_reason\">%s</span> was not able to sign the contract for the following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-} catch (NoObjectException $e) {
- die(sprintf("[Main:] The shipping company <span class=\"exception_reason\">%s</span> was not able to sign the contract for the following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-} catch (MissingMethodException $e) {
- die(sprintf("[Main:] The shipping company <span class=\"exception_reason\">%s</span> was not able to sign the contract for the following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-} catch (InvalidContractPartnerException $e) {
- die(sprintf("[Main:] The shipping company <span class=\"exception_reason\">%s</span> was not able to sign the contract for the following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-} catch (ContractAllreadySignedException $e) {
- die(sprintf("[Main:] The shipping company <span class=\"exception_reason\">%s</span> was not able to sign the contract for the following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-} catch (WrongContractPartnerException $e) {
- die(sprintf("[Main:] The shipping company <span class=\"exception_reason\">%s</span> was not able to sign the contract for the following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $shipping->getCompanyName(),
- $e->getMessage()
- ));
-}
+$shipping->signContract($contract, $shipping);
// Meldung ausgeben
if ($contract->isSigned()) {
//exit();
// Anzahl Betten ermitteln
-try {
- $totalBeds = $contract->getShipInstance()->calcTotalBeds();
-} catch (StructuresOutOfBoundsException $e) {
- die(sprintf("[Main:] Anzahl Betten konnten nicht ermittelt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (EmptyStructuresListException $e) {
- die(sprintf("[Main:] Anzahl Betten konnten nicht ermittelt werden. Grund: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-}
+$totalBeds = $contract->getShipInstance()->calcTotalBeds();
// Bettenanzahl ausgeben
DebugMiddleware::getInstance()->output(sprintf("Es stehen <strong>%d</strong> Betten zur Verfügung.",
<?php
// Change directory
-@chdir("../..");
+@chdir('../..');
// Set testing mode (no starter.php will be loaded!)
define('TEST_MODE', true);
// Load config file
-require(dirname(dirname(dirname(__FILE__))) . "/inc/config.php");
+require(dirname(dirname(dirname(__FILE__))) . '/inc/config.php');
// Load all include files
require($cfg->readConfig('base_path') . 'inc/includes.php');
// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
// jetzt die Personalliste wiederherstellen
-try {
- $personell = SimulatorPersonell::createSimulatorPersonellByID('SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98');
-} catch (InvalidIDFormatException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidArrayCountException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (NullPointerException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (NoObjectException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (MissingMethodException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (FileIsEmptyException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (FilePointerNotOpenedException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidArrayCountException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidMD5ChecksumException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidDataLengthException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidSimulatorIDException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (MismatchingCompressorsException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (ContainerItemIsNullException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (ContainerItemIsNoArrayException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (ContainerMaybeDamagedException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-}
+$personell = SimulatorPersonell::createSimulatorPersonellByID('SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98');
// Personal-Objekt debuggen
if (defined('DEBUG_PERSONELL_OBJ')) {
exit();
// Etwas zum Testen...
-try {
- $personell = SimulatorPersonell::createSimulatorPersonell(20);
-} catch (NullPointerException $e) {
- die(sprintf("[Main:] Personal list not created for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (NoObjectException $e) {
- die(sprintf("[Main:] Personal list not created for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (MissingMethodException $e) {
- die(sprintf("[Main:] Personal list not created for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-}
+$personell = SimulatorPersonell::createSimulatorPersonell(20);
// Personal-Objekt debuggen
if (defined('DEBUG_PERSONELL_OBJ')) {
}
// Try to save the object (for testing purposes)
-try {
- $personell->saveObjectToDatabase();
-} catch (NullPointerException $e) {
- die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (NoObjectException $e) {
- die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidObjectException $e) {
- die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (MissingMethodException $e) {
- die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (UnsupportedLimitationPartException $e) {
- die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidArrayCountException $e) {
- die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-}
+$personell->saveObjectToDatabase();
//
?>
<?php
// Change directory
-@chdir("../..");
+@chdir('../..');
// Set testing mode (no starter.php will be loaded!)
define('TEST_MODE', true);
// Load config file
-require(dirname(dirname(dirname(__FILE__))) . "/inc/config.php");
+require(dirname(dirname(dirname(__FILE__))) . '/inc/config.php');
// Load all include files
require($cfg->readConfig('base_path') . 'inc/includes.php');
// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
// jetzt die Personalliste wiederherstellen
-try {
- $personell = SimulatorPersonell::createSimulatorPersonellByID('SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98');
-} catch (InvalidIDFormatException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidArrayCountException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (NullPointerException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (NoObjectException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (MissingMethodException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (FileIsEmptyException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (FilePointerNotOpenedException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidArrayCountException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidMD5ChecksumException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidDataLengthException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidSimulatorIDException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (MismatchingCompressorsException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (ContainerItemIsNullException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (ContainerItemIsNoArrayException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (ContainerMaybeDamagedException $e) {
- die(sprintf("[Main:] Could not create personal list for follwing reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-}
+$personell = SimulatorPersonell::createSimulatorPersonellByID('SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98');
// Personal-Objekt debuggen
if (defined('DEBUG_PERSONELL_OBJ')) {
exit();
// Etwas zum Testen...
-try {
- $personell = SimulatorPersonell::createSimulatorPersonell(20);
-} catch (NullPointerException $e) {
- die(sprintf("[Main:] Personal list not created for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (NoObjectException $e) {
- die(sprintf("[Main:] Personal list not created for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (MissingMethodException $e) {
- die(sprintf("[Main:] Personal list not created for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-}
+$personell = SimulatorPersonell::createSimulatorPersonell(20);
// Personal-Objekt debuggen
if (defined('DEBUG_PERSONELL_OBJ')) {
}
// Try to save the object (for testing purposes)
-try {
- $personell->saveObjectToDatabase();
-} catch (NullPointerException $e) {
- die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (NoObjectException $e) {
- die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidObjectException $e) {
- die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (MissingMethodException $e) {
- die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (UnsupportedLimitationPartException $e) {
- die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-} catch (InvalidArrayCountException $e) {
- die(sprintf("[Main:] Object not saved for following reason: <span class=\"exception_reason\">%s</span><br />\n",
- $e->getMessage()
- ));
-}
+$personell->saveObjectToDatabase();
//
?>