7 require(dirname(dirname(__FILE__)) . "/inc/config.php");
9 // Load all include files
10 require(PATH . "inc/includes.php");
12 // Load all game classes
13 require(PATH . "inc/classes.php");
15 // Set default application
16 FrameworkConfiguration::getInstance()->setConfigEntry("default_application", "ship-simu");
18 // Set testing mode (no starter.php will be loaded!)
19 define('TEST_MODE', true);
21 // Load the "selector"
22 require(PATH . "inc/selector.php");
24 // Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
25 // jetzt die Personalliste wiederherstellen
27 $personell = SimulatorPersonell::createSimulatorPersonellByID("SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98");
28 } catch (InvalidIDFormatException $e) {
29 die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
32 } catch (InvalidArrayCountException $e) {
33 die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
36 } catch (NullPointerException $e) {
37 die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
40 } catch (NoObjectException $e) {
41 die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
44 } catch (MissingMethodException $e) {
45 die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
48 } catch (FileIsEmptyException $e) {
49 die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
52 } catch (FilePointerNotOpenedException $e) {
53 die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
56 } catch (InvalidArrayCountException $e) {
57 die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
60 } catch (InvalidMD5ChecksumException $e) {
61 die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
64 } catch (InvalidDataLengthException $e) {
65 die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
68 } catch (InvalidSimulatorIDException $e) {
69 die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
72 } catch (MismatchingCompressorsException $e) {
73 die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
76 } catch (ContainerItemIsNullException $e) {
77 die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
80 } catch (ContainerItemIsNoArrayException $e) {
81 die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
84 } catch (ContainerMaybeDamagedException $e) {
85 die(sprintf("[Main:] Die Personenliste konnte nicht erstellt werden. Grund: <strong>%s</strong><br />\n",
90 // Personal-Objekt debuggen
91 if (defined('DEBUG_PERSONELL_OBJ')) {
92 DebugMiddleware::getInstance()->output(sprintf("Das Personal-Objekt sieht wie folgt aus:<br />
94 print_r($personell, true)
98 // Erstmal bis hier hin
101 // Etwas zum Testen...
103 $personell = SimulatorPersonell::createSimulatorPersonell(20);
104 } catch (NullPointerException $e) {
105 die(sprintf("[Main:] Personenliste nicht angelegt. Grund: <strong>%s</strong><br />\n",
108 } catch (NoObjectException $e) {
109 die(sprintf("[Main:] Personenliste nicht angelegt. Grund: <strong>%s</strong><br />\n",
112 } catch (MissingMethodException $e) {
113 die(sprintf("[Main:] Personenliste nicht angelegt. Grund: <strong>%s</strong><br />\n",
118 // Personal-Objekt debuggen
119 if (defined('DEBUG_PERSONELL_OBJ')) {
120 DebugMiddleware::getInstance()->output(sprintf("Das Personal-Objekt sieht wie folgt aus:<br />
122 print_r($personell, true)
126 // Try to save the object (for testing purposes)
128 $personell->saveObjectToDatabase();
129 } catch (NullPointerException $e) {
130 die(sprintf("[Main:] Objekt nicht gespeichert. Grund: <strong>%s</strong><br />\n",
133 } catch (NoObjectException $e) {
134 die(sprintf("[Main:] Objekt nicht gespeichert. Grund: <strong>%s</strong><br />\n",
137 } catch (InvalidObjectException $e) {
138 die(sprintf("[Main:] Objekt nicht gespeichert. Grund: <strong>%s</strong><br />\n",
141 } catch (MissingMethodException $e) {
142 die(sprintf("[Main:] Objekt nicht gespeichert. Grund: <strong>%s</strong><br />\n",
145 } catch (UnsupportedLimitationPartException $e) {
146 die(sprintf("[Main:] Objekt nicht gespeichert. Grund: <strong>%s</strong><br />\n",
149 } catch (GetterNotFoundException $e) {
150 die(sprintf("[Main:] Objekt nicht gespeichert. Grund: <strong>%s</strong><br />\n",
153 } catch (NoArrayCreatedException $e) {
154 die(sprintf("[Main:] Objekt nicht gespeichert. Grund: <strong>%s</strong><br />\n",
157 } catch (InvalidArrayCountException $e) {
158 die(sprintf("[Main:] Objekt nicht gespeichert. Grund: <strong>%s</strong><br />\n",