From: Roland Häder Date: Sat, 21 Jun 2008 21:01:42 +0000 (+0000) Subject: A lot debug messages removed, mailer with stubs added, resend link basicly finished... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b3e47fb693fb8d40868158b0192b3392b309d97a;p=shipsimu.git A lot debug messages removed, mailer with stubs added, resend link basicly finished - except mailing --- diff --git a/.gitattributes b/.gitattributes index 27e7b4a..906be9e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -305,6 +305,8 @@ inc/classes/interfaces/language/.htaccess -text inc/classes/interfaces/language/class_ManageableLanguage.php -text inc/classes/interfaces/login/.htaccess -text inc/classes/interfaces/login/class_LoginableUser.php -text +inc/classes/interfaces/mailer/.htaccess -text +inc/classes/interfaces/mailer/class_DeliverableMail.php -text inc/classes/interfaces/reader/.htaccess -text inc/classes/interfaces/reader/class_ReadableNews.php -text inc/classes/interfaces/registration/.htaccess -text @@ -333,7 +335,10 @@ inc/classes/interfaces/template/.htaccess -text inc/classes/interfaces/template/class_CompileableTemplate.php -text inc/classes/interfaces/template/view/class_ViewHelper.php -text inc/classes/interfaces/user/.htaccess -text -inc/classes/interfaces/user/class_ManageableUser.php -text +inc/classes/interfaces/user/class_ManageableAccount.php -text +inc/classes/interfaces/user/extended/.htaccess -text +inc/classes/interfaces/user/extended/class_ManageableGuest.php -text +inc/classes/interfaces/user/extended/class_ManageableUser.php -text inc/classes/main/.htaccess -text inc/classes/main/actions/.htaccess -text inc/classes/main/actions/class_ -text @@ -457,6 +462,11 @@ inc/classes/main/io/class_FrameworkFileInputPointer.php -text inc/classes/main/io/class_FrameworkFileOutputPointer.php -text inc/classes/main/language/.htaccess -text inc/classes/main/language/class_LanguageSystem.php -text +inc/classes/main/mailer/.htaccess -text +inc/classes/main/mailer/class_ -text +inc/classes/main/mailer/class_BaseMailer.php -text +inc/classes/main/mailer/debug/.htaccess -text +inc/classes/main/mailer/debug/class_DebugMailer.php -text inc/classes/main/output/.htaccess -text inc/classes/main/output/class_ConsoleOutput.php -text inc/classes/main/output/class_WebOutput.php -text diff --git a/application/ship-simu/main/class_BasePersonell.php b/application/ship-simu/main/class_BasePersonell.php index 65df945..368fbfa 100644 --- a/application/ship-simu/main/class_BasePersonell.php +++ b/application/ship-simu/main/class_BasePersonell.php @@ -58,10 +58,6 @@ class BasePersonell extends BaseFrameworkSystem implements Personellizer { // Remove min/max ages public final function removeMinMaxAge () { - if (defined('DEBUG_PERSONELL')) $this->getDebugInstance()->output(sprintf("[%s:%d] Minimum-/Maximum-Alter entfernt.
\n", - __CLASS__, - __LINE__ - )); unset($this->MIN_AGE); unset($this->MAX_AGE); } diff --git a/application/ship-simu/main/class_BaseSimulator.php b/application/ship-simu/main/class_BaseSimulator.php index ffdbc66..3f7daa1 100644 --- a/application/ship-simu/main/class_BaseSimulator.php +++ b/application/ship-simu/main/class_BaseSimulator.php @@ -57,52 +57,31 @@ class BaseSimulator extends BaseFrameworkSystem { // Setter-Methode fuer Laenge public final function setLength ($length) { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] %dm Länge gesetzt.
\n", - $this->__toString(), - $length - )); $this->length = (float) $length; } // Setter-Methode fuer Breite public final function setWidth ($width) { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] %dm Breite gesetzt.
\n", - $this->__toString(), - $width - )); $this->width = (float) $width; } // Setter-Methode fuer Hoehe public final function setHeight ($height) { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] %dm Höhe gesetzt.
\n", - $this->__toString(), - $height - )); $this->height = (float) $height; } // Getter-Methode fuer Laenge public final function getLength () { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Länge angefordert.
\n", - $this->__toString() - )); return $this->length; } // Getter-Methode fuer Breite public final function getWidth () { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Länge angefordert.
\n", - $this->__toString() - )); return $this->width; } // Getter-Methode fuer Hoehe public final function getHeight () { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Höhe angefordert.
\n", - $this->__toString() - )); return $this->height; } @@ -121,18 +100,7 @@ class BaseSimulator extends BaseFrameworkSystem { // Remover-Methode fuer die Teil-Instanz public final function removePartInstance () { - if ($this->getPartInstance() !== null) { - // Warnung ausgeben - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] partInstance ist nicht null! Instanz-Attribut wird nicht entfernt.
\n", - $this->__toString() - )); - } else { - // Leere Instanz kann entfernt werden - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] partInstance wurde entfernt.
\n", - $this->__toString() - )); - unset($this->partInstance); - } + unset($this->partInstance); } // Prueft ob all Umberechnungsfaktoren gesetzt sind @@ -149,7 +117,7 @@ class BaseSimulator extends BaseFrameworkSystem { $this->currShip = $shipInstance; $this->currPart = $partInstance; - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Maschinenraum mit Motor %s wird fuer das Schiff %s konstruiert.
\n", + if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Maschinenraum mit Motor %s wird fuer das Schiff %s konstruiert.", $this->__toString(), $this->getCurrPart()->getObjectDescription(), $this->currShip->getShipName() @@ -158,7 +126,7 @@ class BaseSimulator extends BaseFrameworkSystem { // Passt ueberhaupt das Schiffsteil in's Schiff? if ($this->isShipPartSizeValid()) { // Berechnungen fuer umliegendes Objekt anpassen - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Das Schiffsteil %s vom Typ %s passt in das Schiff %s hinein.
\n", + if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Das Schiffsteil %s vom Typ %s passt in das Schiff %s hinein.", $this->__toString(), $this->getCurrPart()->getObjectDescription(), $this->getCurrPart()->__toString(), @@ -175,7 +143,7 @@ class BaseSimulator extends BaseFrameworkSystem { // Passt dies nun immer noch? if ($this->isNewSizeValid()) { // Das passt auch, dann Werte setzen und Motor-Instanz merken - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Das Schiffsteil %s passt in das Schiff %s hinein.
\n", + if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Das Schiffsteil %s passt in das Schiff %s hinein.", $this->__toString(), $this->getObjectDescription(), $this->currShip->getShipName() @@ -204,7 +172,7 @@ class BaseSimulator extends BaseFrameworkSystem { // Existiert ein Schiffsteil? if (!is_null($this->currPart)) { // Debug-Meldung ausgeben - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Schiffsteil %s gefunden.
\n", + if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Schiffsteil %s gefunden.", $this->getCurrPart()->realClass, $this->getCurrPart()->getObjectDescription() )); @@ -235,9 +203,6 @@ class BaseSimulator extends BaseFrameworkSystem { // Array fuer Umrechnungstabelle entfernen public final function removeResizeFactorArray () { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] removeResizeFactor erreicht.
\n", - $this->__toString() - )); unset($this->resizeFactorArray); } @@ -258,82 +223,52 @@ class BaseSimulator extends BaseFrameworkSystem { * @return void */ public final function removeCurrShip () { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] removeCurrShip erreicht.
\n", - $this->__toString() - )); unset($this->currShip); } // Aktuelle Schiffsteil-Instanz entfernen public final function removeCurrPart () { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] removeCurrPart erreicht.
\n", - $this->__toString() - )); unset($this->currPart); } // Breite entfernen public final function removeWidth () { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Breite entfernt.
\n", - $this->__toString() - )); unset($this->width); } // Hoehe entfernen public final function removeHeight () { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Höhe entfernt.
\n", - $this->__toString() - )); unset($this->height); } // Laenge entfernen public final function removeLength () { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Länge entfernt.
\n", - $this->__toString() - )); unset($this->length); } // Tiefgang entfernen public final function removeDraught () { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Tiefgang entfernt.
\n", - $this->__toString() - )); unset($this->draught); } // Getter-Methode fuer Element aus resizeFactor public final function getResizeFactorElement ($el) { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] getResizeFactorElement erreicht. (element=%s)
\n", - $this->__toString(), - $el - )); if (isset($this->resizeFactorArray[$el])) { // Element gefunden return $this->resizeFactorArray[$el]; } else { // Element nicht gefunden! - return 0; + return null; } } // Setter-Methode fuer Element in resizeFactor public final function setResizeFactorElement ($el, $value) { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Umberechnungsfaktor %s=%s gesetzt.
\n", - $this->__toString(), - $el, - $value - )); $this->resizeFactorArray[$el] = (float) $value; } // Kontrolliert, ob die Abmasse Schiffsteil->Schiff stimmen public function isShipPartSizeValid () { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] isShipPartSizeValid erreicht.
\n", - $this->__toString() - )); return ( ( ( // Already defined ship messurings @@ -354,9 +289,6 @@ class BaseSimulator extends BaseFrameworkSystem { // Kontrolliert, ob die Abmasse Maschinenraum->Schiff stimmen public function isNewSizeValid () { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] isNewSizeValid erreicht.
\n", - $this->__toString() - )); return ( ( // Already defined ship messurings ($this->newWidth < $this->currShip->getWidth()) @@ -372,11 +304,6 @@ class BaseSimulator extends BaseFrameworkSystem { // Masse extrahieren public function extractDimensions ($dim) { - if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] extractDimensions erreicht für %s.
\n", - $this->__toString(), - $this->getObjectDescription() - )); - // Abmasse setzen if ((isset($dim)) && (is_array($dim)) && (count($dim) == 3)) { // Abmasse aus Array holen diff --git a/application/ship-simu/main/class_Merchant.php b/application/ship-simu/main/class_Merchant.php index e993c2d..fc3d860 100644 --- a/application/ship-simu/main/class_Merchant.php +++ b/application/ship-simu/main/class_Merchant.php @@ -56,7 +56,7 @@ class Merchant extends BaseFrameworkSystem { // Debug message if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) { - $merchantInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Händler %s wird angelegt und soll sich am %s niederlassen.
\n", + $merchantInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Händler %s wird angelegt und soll sich am %s niederlassen.", __CLASS__, __LINE__, $merchantName, @@ -79,57 +79,27 @@ class Merchant extends BaseFrameworkSystem { // Initialize pricing list private function createPriceList () { - if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händler %s erhält eine leere Preisliste.
\n", - __CLASS__, - __LINE__, - $this->getMerchantName() - )); $this->priceList = new FrameworkArrayObject("FakedPriceList"); } // Setter for merchant name public final function setMerchantName ($merchantName) { - // Secure string - $merchantName = (string) $merchantName; - // Debug message - if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händlername %s ist nun bekannt.
\n", - __CLASS__, - __LINE__, - $merchantName - )); - $this->merchantName = $merchantName; + $this->merchantName = (string) $merchantName; } // Getter for merchant name public final function getMerchantName () { - if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händlername %s wird verlangt.
\n", - __CLASS__, - __LINE__, - $this->merchantName - )); return $this->merchantName; } // Setter for harbor instance public final function setHarborInstance (Harbor $harborInstance) { - if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händler %s lässt sich am %s nieder.
\n", - __CLASS__, - __LINE__, - $this->getMerchantName(), - $harborInstance->getHarborName() - )); $this->harborInstance = $harborInstance; } // Getter for harbor instance public final function getHarborInstance () { - if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händler %s hat sich am %s niedergelassen.
\n", - __CLASS__, - __LINE__, - $this->getMerchantName(), - $harborInstance->getHarborName() - )); return $this->harborInstance; } @@ -139,7 +109,7 @@ class Merchant extends BaseFrameworkSystem { $price = (float) $price; // Debug message - if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händler %s kann nun das Schiffsteil %s "%s" zu %s verkaufen.
\n", + if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händler %s kann nun das Schiffsteil %s "%s" zu %s verkaufen.", __CLASS__, __LINE__, $this->getMerchantName(), diff --git a/application/ship-simu/main/class_WorksContract.php b/application/ship-simu/main/class_WorksContract.php index 80ae2ea..b776759 100644 --- a/application/ship-simu/main/class_WorksContract.php +++ b/application/ship-simu/main/class_WorksContract.php @@ -65,7 +65,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { $contractInstance = new WorksContract(); // Debug-Meldung ausgeben - if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $contractInstance->getDebugInstance()->output(sprintf("[%s:%d] Neuer Bauvertrag wird für das Schiff %s mit der %s %s erstellt.
\n", + if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $contractInstance->getDebugInstance()->output(sprintf("[%s:%d] Neuer Bauvertrag wird für das Schiff %s mit der %s %s erstellt.", __CLASS__, __LINE__, $shipName, @@ -98,40 +98,21 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { // Setter for ship instance private final function setShipInstance (ConstructableShip $shipInstance) { - if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff %s wird in den Bauvertrag aufgenommen.
\n", - __CLASS__, - __LINE__, - $shipInstance->getShipName() - )); $this->shipInstance = $shipInstance; } // Setter for ship name private final function setShipName ($shipName) { - if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das neue Schiff wird %s heissen.
\n", - __CLASS__, - __LINE__, - $shipName - )); $this->shipName = (string) $shipName; } // Getter for ship name public final function getShipName () { - if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Schiffsname %s angefordert.
\n", - __CLASS__, - __LINE__, - $this->shipName - )); return $this->shipName; } // Getter for ship instance public final function getShipInstance () { - if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Schiff-Instanz angefordert.
\n", - __CLASS__, - __LINE__ - )); return $this->shipInstance; } @@ -142,7 +123,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { $parentPart = (string) $parentPart; // Debug message - if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiffsteil %s wird zusammen mit dem Konstruktionsteil %s in den Bauvertrag aufgenommen.
\n", + if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiffsteil %s wird zusammen mit dem Konstruktionsteil %s in den Bauvertrag aufgenommen.", __CLASS__, __LINE__, $shipPart, @@ -162,7 +143,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { )); // Debug message - if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Versuche ein Schiffsteil in den Bauvertrag aufzunehmen.
\n", + if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Versuche ein Schiffsteil in den Bauvertrag aufzunehmen.", __CLASS__, __LINE__ )); @@ -186,7 +167,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { $price = $this->getMerchantInstance()->getPriceFromList($partInstance); // Final debug message - if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %s kostet %s.
\n", + if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %s kostet %s.", __CLASS__, __LINE__, $partInstance->getObjectDescription(), @@ -197,7 +178,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { $partInstance->setPrice($price); // Final debug message - if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %s wurde in den Bauvertrag aufgenommen.
\n", + if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %s wurde in den Bauvertrag aufgenommen.", __CLASS__, __LINE__, $partInstance->getObjectDescription() @@ -258,7 +239,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) { if ($partnerInstance->equals($partyInstance)) { // With itself - $this->getDebugInstance()->output(sprintf("[%s:%d] Die %s %s stimmt einem Bauvertrag über das %s %s zu.
\n", + $this->getDebugInstance()->output(sprintf("[%s:%d] Die %s %s stimmt einem Bauvertrag über das %s %s zu.", __CLASS__, __LINE__, $partnerInstance->getObjectDescription(), @@ -268,7 +249,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { )); } else { // Other contract party - $this->getDebugInstance()->output(sprintf("[%s:%d] Die %s %s geht mit der %s %s einen Bauvertrag über das %s %s ein.
\n", + $this->getDebugInstance()->output(sprintf("[%s:%d] Die %s %s geht mit der %s %s einen Bauvertrag über das %s %s ein.", __CLASS__, __LINE__, $partnerInstance->getObjectDescription(), diff --git a/application/ship-simu/main/companies/class_ShippingCompany.php b/application/ship-simu/main/companies/class_ShippingCompany.php index 895a19a..322a61a 100644 --- a/application/ship-simu/main/companies/class_ShippingCompany.php +++ b/application/ship-simu/main/companies/class_ShippingCompany.php @@ -86,7 +86,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Get new instance $companyInstance = new ShippingCompany(); - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $companyInstance->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s wird gegründet.
\n", + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $companyInstance->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s wird gegründet.", __CLASS__, __LINE__, $companyName @@ -123,7 +123,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Angestellten-Liste erstellen private function createEmployeeList () { - if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s erhält eine Angestelltenliste.
\n", + if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s erhält eine Angestelltenliste.", __CLASS__, __LINE__, $this->getCompanyName() @@ -133,7 +133,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Werftenliste erstellen public function createShipyardList () { - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s erhält eine Werftsliste.
\n", + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s erhält eine Werftsliste.", __CLASS__, __LINE__, $this->getCompanyName() @@ -143,7 +143,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Auftragsliste erstellen public function createContractList () { - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s erhält eine Auftragsliste.
\n", + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s erhält eine Auftragsliste.", __CLASS__, __LINE__, $this->getCompanyName() @@ -177,7 +177,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Reedereien Werften bauen lassen public function createShipyardInHarbor($shipyardName, Harbor $harborInstance) { - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s baut im %s eine Werft %s.
\n", + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s baut im %s eine Werft %s.", __CLASS__, __LINE__, $this->getCompanyName(), @@ -198,13 +198,6 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Setter fuer Reederei-Gruender public final function setCompanyFounder(CompanyEmployee $founderInstance) { - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s ist von %s %s gegründet worden.
\n", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $founderInstance->getSurname(), - $founderInstance->getFamily() - )); $this->founderInstance = $founderInstance; } @@ -215,26 +208,11 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Neue(n) Angestellte(n) in Angestellten-Liste aufnehmen public function addNewEmployee (SimulatorPersonell $employeeInstance) { - if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %s %s tritt der Reederei %s als %s bei und erhält ein Gehalt von %s.
\n", - __CLASS__, - __LINE__, - $employeeInstance->getSurname(), - $employeeInstance->getFamily(), - $this->getCompanyName(), - $employeeInstance->getObjectDescription(), - $this->formatCurrency($employeeInstance->getSalary()) - )); $this->employeeList->append($employeeInstance); } // Neue Werft in Liste aufnehmen public function addNewShipyard (Shipyard $shipyardInstance) { - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s erhält die Werft %s hinzugefügt.
\n", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $shipyardInstance->getShipyardName() - )); $this->shipyardList->append($shipyardInstance); } @@ -244,7 +222,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner $amount = (int) $amount; // Debug-Meldung ausgeben - if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s stellt per Zufall %d neue Mitarbeiter ein.
\n", + if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s stellt per Zufall %d neue Mitarbeiter ein.", __CLASS__, __LINE__, $this->getCompanyName(), @@ -258,7 +236,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner if ($totalUnemployed < $amount) { // Reichte nicht aus! throw new ToMuchEmployeesException(array($amount, $personellInstance->getAllUnemployed()), self::EXCEPTION_NOT_ENOUGTH_UNEMPLOYEES); - } + } // END - if // Get list for all unemployed people $list = $personellInstance->getSpecialPersonellList(false); // Should be cached @@ -298,7 +276,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner $employee->increaseSalary((mt_rand(7, 14) * 100)); // Are 700 to 1400 EUR for the begin okay? // Debug message - if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s stellt den/die Angestellte(n) %s %s ein.
\n", + if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s stellt den/die Angestellte(n) %s %s ein.", __CLASS__, __LINE__, $this->getCompanyName(), @@ -314,7 +292,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner $personellInstance->resetCache(); // Debug-Meldung ausgeben - if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s hat per Zufall %d neue Mitarbeiter eingestellt.
\n", + if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s hat per Zufall %d neue Mitarbeiter eingestellt.", __CLASS__, __LINE__, $this->getCompanyName(), @@ -324,7 +302,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Distribute all personells on all shipyards public function distributeAllPersonellOnShipyards () { - if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s verteilt alle ihre %d Mitarbeiter auf alle %d Werft(en).
\n", + if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s verteilt alle ihre %d Mitarbeiter auf alle %d Werft(en).", __CLASS__, __LINE__, $this->getCompanyName(), @@ -378,7 +356,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner $total = $this->employeeList->count(); // Debug message - if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s hat %d Mitarbeiter.
\n", + if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s hat %d Mitarbeiter.", __CLASS__, __LINE__, $this->getCompanyName(), @@ -391,7 +369,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Getter for total shipyards public final function getTotalShipyards () { - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Für die Reederei %s werden die Anzahl der Werften in allen Häfen ermittelt.
\n", + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Für die Reederei %s werden die Anzahl der Werften in allen Häfen ermittelt.", __CLASS__, __LINE__, $this->getCompanyName() @@ -407,7 +385,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner $total = $this->shipyardList->count(); // Debug message - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s hat %d Werft(en).
\n", + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s hat %d Werft(en).", __CLASS__, __LINE__, $this->getCompanyName(), @@ -436,7 +414,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner )); // Debug message - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s baut in allen Werften bald Schiffe vom Typ %s.
\n", + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s baut in allen Werften bald Schiffe vom Typ %s.", __CLASS__, __LINE__, $this->getCompanyName(), @@ -467,7 +445,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Validate the requested ship type with the company if they can construct it public function validateWorksContractShipType (SignableContract $contractInstance) { - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s prüft den Bauauftrag der %s.
\n", + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s prüft den Bauauftrag der %s.", __CLASS__, __LINE__, $this->getCompanyName(), @@ -490,7 +468,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner $shipType = $shipInstance->__toString(); // Debug message - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s prüft, ob die %s (Typ:%s) gebaut werden kann.
\n", + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s prüft, ob die %s (Typ:%s) gebaut werden kann.", __CLASS__, __LINE__, $this->getCompanyName(), @@ -508,7 +486,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner $shipType = (string) $shipType; // Debug message - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s fragt alle Werften ab, ob diese Schiffe vom Typ %s bauen können.
\n", + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s fragt alle Werften ab, ob diese Schiffe vom Typ %s bauen können.", __CLASS__, __LINE__, $this->getCompanyName(), @@ -543,7 +521,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } // Debug message - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s hat die Suche nach einer Werft beendet, die Schiffe vom Typ %s bauen kann.
\n", + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s hat die Suche nach einer Werft beendet, die Schiffe vom Typ %s bauen kann.", __CLASS__, __LINE__, $this->getCompanyName(), @@ -556,7 +534,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // As a customer the shipping company can add new contracts public function addNewWorksContract (SignableContract $contractInstance) { - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s erstellt einen Bauauftrag für ein %s mit dem Namen %s.
\n", + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s erstellt einen Bauauftrag für ein %s mit dem Namen %s.", __CLASS__, __LINE__, $this->getCompanyName(), @@ -594,7 +572,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Determine if company "signs" own contract (must be done) or with an other party if ($this->equals($partnerInstance)) { // With itself - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s erteilt an sich selbst einen Bauauftrag für das %s "%s".
\n", + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s erteilt an sich selbst einen Bauauftrag für das %s "%s".", __CLASS__, __LINE__, $this->getCompanyName(), @@ -603,7 +581,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner )); } else { // Other external company - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s unterzeichnet einen Bauauftrag für das %s "%s" mit der %s.
\n", + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s unterzeichnet einen Bauauftrag für das %s "%s" mit der %s.", __CLASS__, __LINE__, $this->getCompanyName(), diff --git a/application/ship-simu/main/constructions/harbors/class_Harbor.php b/application/ship-simu/main/constructions/harbors/class_Harbor.php index 90c5f9b..3178166 100644 --- a/application/ship-simu/main/constructions/harbors/class_Harbor.php +++ b/application/ship-simu/main/constructions/harbors/class_Harbor.php @@ -56,7 +56,7 @@ class Harbor extends BaseConstruction { $harborInstance = new Harbor(); // Debug message - if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $harborInstance->getDebugInstance()->output(sprintf("[Harbor:] Der Hafen %s wird konstruiert.
\n", $harborName)); + if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $harborInstance->getDebugInstance()->output(sprintf("[Harbor:] Der Hafen %s wird konstruiert.", $harborName)); // Hafenname setzen $harborInstance->setHarborName($harborName); @@ -65,7 +65,7 @@ class Harbor extends BaseConstruction { $harborInstance->createshipyardList(); // Debug-Meldung ausgeben - if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $harborInstance->getDebugInstance()->output(sprintf("[Harbor:] Der Hafen %s ist jetzt fertig gebaut.
\n", $harborName)); + if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $harborInstance->getDebugInstance()->output(sprintf("[Harbor:] Der Hafen %s ist jetzt fertig gebaut.", $harborName)); // Instanz zurueckliefern return $harborInstance; @@ -73,40 +73,27 @@ class Harbor extends BaseConstruction { // Werft-Liste generieren public function createshipyardList () { - if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[Harbor:] Werft-Liste wird für den Hafen %s erstellt.
\n", - $this->getHarborName() - )); $this->shipyardList = new FrameworkArrayObject("FakedShipyardList"); } // Setter fuer Hafennamen public final function setHarborName ($harborName) { - if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[Harbor:] Der Hafen heisst jetzt %s.
\n", $harborName)); $this->harborName = (string) $harborName; } // Getter fuer Hafennamen public final function getHarborName () { - if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[Harbor:] Hafenname %s wurde angefordert.
\n", $this->harborName)); return $this->harborName; } // Werft in den Hafen einbauen und Werft->Reederei zuweisen public function addNewShipyardNotify ($shipyardName, ShippingCompany $companyInstance) { - if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[Harbor:] Die Werft %s wird im Hafen %s gebaut.
\n", - $shipyardName, $this->getHarborName() - )); - // Werft generieren und in die Werftliste aufnehmen $this->shipyardList->append(Shipyard::createShipyardNotify($this, $shipyardName, $companyInstance)); } // Werft in den Hafen einbauen ohne Zuweisung einer Reederei (gehoert der "Stadt" dann) public function addNewShipyard ($shipyardName) { - if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[Harbor:] Die Werft %s wird im Hafen %s gebaut.
\n", - $shipyardName, $this->getHarborName() - )); - // Werft generieren und in die Werftliste aufnehmen $this->shipyardList->append(Shipyard::createShipyard($this, $shipyardName)); } diff --git a/application/ship-simu/main/constructions/yards/class_Shipyard.php b/application/ship-simu/main/constructions/yards/class_Shipyard.php index d3a015c..666fe46 100644 --- a/application/ship-simu/main/constructions/yards/class_Shipyard.php +++ b/application/ship-simu/main/constructions/yards/class_Shipyard.php @@ -27,10 +27,10 @@ class Shipyard extends BaseConstruction { private $shipyardName = "Namenlose Werft"; // Arbeiter-Liste - private $staffList = null; + private $staffList = null; // Queue-Liste fuer zu bauende Schiffe - private $queueList = null; + private $queueList = null; // Aktuell im Bau befindliches Schiff private $currShipInConst = null; @@ -81,7 +81,7 @@ class Shipyard extends BaseConstruction { $shipyardInstance = new Shipyard(); // Debug message - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Werft mit dem Namen %s wird im Hafen %s konstruiert.
\n", + if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Werft mit dem Namen %s wird im Hafen %s konstruiert.", __CLASS__, __LINE__, $shipyardName, @@ -104,7 +104,7 @@ class Shipyard extends BaseConstruction { $shipyardInstance->removeSystemArray(); // Debug-Meldung - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s wurde gebaut.
\n", + if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s wurde gebaut.", __CLASS__, __LINE__, $shipyardName @@ -116,21 +116,11 @@ class Shipyard extends BaseConstruction { // Create staff list private function createStaffList () { - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s erhält eine Arbeiterliste.
\n", - __CLASS__, - __LINE__, - $this->getShipyardName() - )); $this->staffList = new FrameworkArrayObject("FakedStaffList"); } // Create ship type list private function createShipTypeList () { - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s erhält eine Typenliste.
\n", - __CLASS__, - __LINE__, - $this->getShipyardName() - )); $this->shipTypeList = new FrameworkArrayObject("FakedShipTypeList"); } @@ -176,7 +166,7 @@ class Shipyard extends BaseConstruction { $shipType = (string) $shipType; // Debug message - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s kann bald Schiffe vom Typ %s bauen.
\n", + if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s kann bald Schiffe vom Typ %s bauen.", __CLASS__, __LINE__, $this->getShipyardName(), @@ -196,7 +186,7 @@ class Shipyard extends BaseConstruction { $shipType = (string) $shipType; // Debug message - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s prüft, ob Schiffe vom Typ %s baubar sind.
\n", + if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s prüft, ob Schiffe vom Typ %s baubar sind.", __CLASS__, __LINE__, $this->getShipyardName(), @@ -216,7 +206,7 @@ class Shipyard extends BaseConstruction { } // Debug message - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s hat die Suche nach dem Schiffstyp %s abgeschlossen.
\n", + if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s hat die Suche nach dem Schiffstyp %s abgeschlossen.", __CLASS__, __LINE__, $this->getShipyardName(), diff --git a/application/ship-simu/main/drives/class_BaseDrive.php b/application/ship-simu/main/drives/class_BaseDrive.php index 4891d73..a177998 100644 --- a/application/ship-simu/main/drives/class_BaseDrive.php +++ b/application/ship-simu/main/drives/class_BaseDrive.php @@ -44,21 +44,11 @@ class BaseDrive extends BaseSimulator { // Setter-Methode fuert PS-Zahl public final function setHorsePower ($hp) { - if ((defined('DEBUG_DRIVE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Antriebsleistung wird auf %d PS gesetzt.
\n", - __CLASS__, - __LINE__, - $hp - )); $this->horsePower = (int) $hp; } // Setter-Methode fuer Nockenanzahl public final function setNumCams ($cams) { - if ((defined('DEBUG_DRIVE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Nockenanzahl wird auf %d Nocken gesetzt.
\n", - __CLASS__, - __LINE__, - $cams - )); $this->numCams = (int) $cams; } diff --git a/application/ship-simu/main/drives/motor/class_Motor.php b/application/ship-simu/main/drives/motor/class_Motor.php index 48573fa..a0778b0 100644 --- a/application/ship-simu/main/drives/motor/class_Motor.php +++ b/application/ship-simu/main/drives/motor/class_Motor.php @@ -43,7 +43,7 @@ class Motor extends BaseDrive implements TradeableItem, ConstructableShipPart { $motorInstance = new Motor(); // Debug message - if ((defined('DEBUG_DRIVE')) || (defined('DEBUG_ALL'))) $motorInstance->getDebugInstance()->output(sprintf("[%s:%d] Motor %s wird gebaut...
\n", + if ((defined('DEBUG_DRIVE')) || (defined('DEBUG_ALL'))) $motorInstance->getDebugInstance()->output(sprintf("[%s:%d] Motor %s wird gebaut...", __CLASS__, __LINE__, $descr diff --git a/application/ship-simu/main/login/helper/class_ShipSimuLoginHelper.php b/application/ship-simu/main/login/helper/class_ShipSimuLoginHelper.php index 0e9aee1..04b45c7 100644 --- a/application/ship-simu/main/login/helper/class_ShipSimuLoginHelper.php +++ b/application/ship-simu/main/login/helper/class_ShipSimuLoginHelper.php @@ -70,7 +70,7 @@ class ShipSimuLoginHelper extends BaseLoginHelper implements HelpableLogin { $userInstance = Registry::getRegistry()->getInstance('user'); // Is this instance valid? - if (!$userInstance instanceof ManageableUser) { + if (!$userInstance instanceof ManageableAccount) { // Thrown an exception here throw new UserInstanceMissingException (array($helperInstance, 'user'), self::EXCEPTION_INVALID_USER_INSTANCE); } // END - if diff --git a/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php b/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php index 2828280..16657b0 100644 --- a/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php +++ b/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php @@ -43,7 +43,7 @@ class MaschineRoom extends BaseShipPart { $roomInstance = new MaschineRoom(); // Debug message - if ((defined('DEBUG_MODE')) || (defined('DEBUG_ALL'))) $roomInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Maschinenraum wird konstruiert.
\n", + if ((defined('DEBUG_MODE')) || (defined('DEBUG_ALL'))) $roomInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Maschinenraum wird konstruiert.", __CLASS__, __LINE__ )); diff --git a/application/ship-simu/main/personell/class_SimulatorPersonell.php b/application/ship-simu/main/personell/class_SimulatorPersonell.php index 76d8ecf..724980b 100644 --- a/application/ship-simu/main/personell/class_SimulatorPersonell.php +++ b/application/ship-simu/main/personell/class_SimulatorPersonell.php @@ -82,7 +82,7 @@ class SimulatorPersonell extends BasePersonell { $personellInstance = new SimulatorPersonell(); // Debug message - if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $personellInstance->getDebugInstance()->output(sprintf("[%s:%d] Es werden %d Personal bereitgestellt.
\n", + if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $personellInstance->getDebugInstance()->output(sprintf("[%s:%d] Es werden %d Personal bereitgestellt.", __CLASS__, __LINE__, $amountPersonell @@ -97,7 +97,7 @@ class SimulatorPersonell extends BasePersonell { } // Debug message - if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $personellInstance->getDebugInstance()->output(sprintf("[%s:%d] %d Personal bereitgestellt.
\n", + if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $personellInstance->getDebugInstance()->output(sprintf("[%s:%d] %d Personal bereitgestellt.", __CLASS__, __LINE__, $amountPersonell @@ -194,10 +194,6 @@ class SimulatorPersonell extends BasePersonell { // Create personell list public function createPersonellList () { if (is_null($this->personellList)) { - if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Personell-Liste erstellt.
\n", - __CLASS__, - __LINE__ - )); $this->personellList = new FrameworkArrayObject("FakedPersonellList"); } else { throw new PersonellListAlreadyCreatedException($this, self::EXCEPTION_DIMENSION_ARRAY_INVALID); @@ -206,10 +202,6 @@ class SimulatorPersonell extends BasePersonell { // Remove the personell list private function removePersonellList () { - if (defined('DEBUG_PERSONELL')) $this->getDebugInstance()->output(sprintf("[%s:%d] Personell-Liste entfernt.
\n", - __CLASS__, - __LINE__ - )); unset($this->personellList); } @@ -251,7 +243,7 @@ class SimulatorPersonell extends BasePersonell { // The same (last) conditions? if (($serialized == $this->cacheCond) && (!is_null($this->cacheCond))) { - if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Gecachte Liste wird verwendet.
\n", + if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Gecachte Liste wird verwendet.", __CLASS__, __LINE__ )); @@ -261,7 +253,7 @@ class SimulatorPersonell extends BasePersonell { } // Output debug message - if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Personalliste wird nach Kriterien durchsucht...
\n", + if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Personalliste wird nach Kriterien durchsucht...", __CLASS__, __LINE__ )); @@ -300,11 +292,6 @@ class SimulatorPersonell extends BasePersonell { * @return $count Amount of unemployed personell */ public final function getAllUnemployed () { - if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Es werden alle erwerbslosen Personen gesucht.
\n", - __CLASS__, - __LINE__ - )); - // Get a temporary list $list = $this->getSpecialPersonellList(false); @@ -318,11 +305,6 @@ class SimulatorPersonell extends BasePersonell { * @return void */ private function removeCache () { - if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Cache-Attribute entfernt.
\n", - __CLASS__, - __LINE__ - )); - // Remove cache data unset($this->cacheList); unset($this->cacheCond); @@ -354,10 +336,6 @@ class SimulatorPersonell extends BasePersonell { * @return void */ public function resetCache () { - if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Cache-Liste zurückgesetzt.
\n", - __CLASS__, - __LINE__ - )); $this->setAllCacheList(null); $this->setCacheCond(""); } diff --git a/application/ship-simu/main/personell/company/class_CompanyEmployee.php b/application/ship-simu/main/personell/company/class_CompanyEmployee.php index 06fcd7c..edcc3d4 100644 --- a/application/ship-simu/main/personell/company/class_CompanyEmployee.php +++ b/application/ship-simu/main/personell/company/class_CompanyEmployee.php @@ -47,7 +47,7 @@ class CompanyEmployee extends SimulatorPersonell { // Debug message if (((defined('DEBUG_COMPANY_EMPLOYEE')) && (defined('DEBUG_PERSONELL'))) || (defined('DEBUG_ALL'))) { - $personellInstance->getDebugInstance()->output(sprintf("[%s:%d] Der/Die Angestellte %s %s wird angelegt.
\n", + $personellInstance->getDebugInstance()->output(sprintf("[%s:%d] Der/Die Angestellte %s %s wird angelegt.", __CLASS__, __LINE__, $surname, @@ -86,12 +86,6 @@ class CompanyEmployee extends SimulatorPersonell { // Remove the employee list private function removeEmployeeList () { - if (((defined('DEBUG_COMPANY_EMPLOYEE')) && (defined('DEBUG_PERSONELL'))) || (defined('DEBUG_ALL'))) { - $this->getDebugInstance()->output(sprintf("[%s:%d] Angestellten-List entfernt.
\n", - __CLASS__, - __LINE__ - )); - } unset($this->employeeList); } } diff --git a/application/ship-simu/main/ships/class_BaseShip.php b/application/ship-simu/main/ships/class_BaseShip.php index 18d2eb8..c8079a1 100644 --- a/application/ship-simu/main/ships/class_BaseShip.php +++ b/application/ship-simu/main/ships/class_BaseShip.php @@ -62,7 +62,7 @@ class BaseShip extends BaseSimulator { // buildInstance = Das was in das Schiffsteil evtl. eingebaut werden soll (null = kein besonderes Teil einbauen!) // partClass = Das zu konstruierende Schiffsteil public function createShipPart (ConstructableShipPart $buildInstance, $partClass) { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff %s erhält ein neues Schiffsteil (%s).
\n", + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff %s erhält ein neues Schiffsteil (%s).", __CLASS__, __LINE__, $this->getShipName(), @@ -82,7 +82,7 @@ class BaseShip extends BaseSimulator { try { $partInstance->addShipPartToShip($this, $buildInstance); } catch (MotorShipMismatchException $e) { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff %s hat keinen Motor erhalten! Grund: %s
\n", + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff %s hat keinen Motor erhalten! Grund: %s", __CLASS__, __LINE__, $this->getShipName(), @@ -90,7 +90,7 @@ class BaseShip extends BaseSimulator { )); return false; } catch (RoomShipMismatchException $e) { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff %s hat keinen Maschinenraum erhalten! Grund: %s
\n", + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff %s hat keinen Maschinenraum erhalten! Grund: %s", __CLASS__, __LINE__, $this->getShipName(), @@ -99,7 +99,7 @@ class BaseShip extends BaseSimulator { return false; } catch (StructureShipMismatchException $e) { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff %s hat keine Aufbauten erhalten! Grund: %s
\n", + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff %s hat keine Aufbauten erhalten! Grund: %s", __CLASS__, __LINE__, $this->getShipName(), @@ -107,7 +107,7 @@ class BaseShip extends BaseSimulator { )); return false; } catch (CabinShipMismatchException $e) { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff %s hat keine Kabine erhalten! Grund: %s
\n", + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff %s hat keine Kabine erhalten! Grund: %s", __CLASS__, __LINE__, $this->getShipName(), @@ -115,7 +115,7 @@ class BaseShip extends BaseSimulator { )); return false; } catch (DeckShipMismatchException $e) { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff %s hat kein Deck erhalten! Grund: %s
\n", + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff %s hat kein Deck erhalten! Grund: %s", __CLASS__, __LINE__, $this->getShipName(), @@ -128,7 +128,7 @@ class BaseShip extends BaseSimulator { $this->structures->append($partInstance); // Debug-Meldung ausgeben - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff %s hat das Schiffsteil %s eingebaut bekommen.
\n", + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff %s hat das Schiffsteil %s eingebaut bekommen.", __CLASS__, __LINE__, $this->getShipName(), @@ -146,69 +146,31 @@ class BaseShip extends BaseSimulator { // STUB: Getter-Methode Anzahl Betten public function calcTotalBeds () { - $this->getDebugInstance()->output("[%s:%d] Stub! Anzahl Betten erreicht.
\n"); - return 0; + $this->partialStub("Please implement this stub in your ship!"); } // Setter-Methode fuer Schiffsnamen public final function setShipName ($shipName) { - // Cast the string - $shipName = (string) $shipName; - - // Debug message - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das neue Schiff vom Typ %s wird auf den Namen %s getauft.
\n", - __CLASS__, - __LINE__, - $this->__toString(), - $shipName - )); - - // Set ship name - $this->shipName = $shipName; + $this->shipName = (string) $shipName; } // Getter-Methode fuer Schiffsnamen public final function getShipName () { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das %s ist auf den Namen %s getauft worden.
\n", - __CLASS__, - __LINE__, - $this->__toString(), - $this->shipName - )); return $this->shipName; } // Setter-Methode fuer Tiefgang public final function setDraught ($draught) { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das %s mit dem Namen %s hat einen Tiefgang von %sm.
\n", - __CLASS__, - __LINE__, - $this->__toString(), - $this->shipName, - $draught - )); $this->draught = (int) $draught; } // Getter-Methode fuer Tiefgang public final function getDraught() { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Tiefgang des Schiffes %s wurde angefordert.
\n", - __CLASS__, - __LINE__, - $this->shipName - )); return $this->draught; } // Setter-Methode fuer Anzahl Anker public final function setNumAnchor ($numAnchor) { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das %s mit dem Namen %s hat %s Anker.
\n", - __CLASS__, - __LINE__, - $this->__toString(), - $this->shipName, - $numAnchor - )); $this->numAnchor = (int) $numAnchor; } } diff --git a/application/ship-simu/main/ships/passenger/class_PassengerShip.php b/application/ship-simu/main/ships/passenger/class_PassengerShip.php index f2ac31a..55363e2 100644 --- a/application/ship-simu/main/ships/passenger/class_PassengerShip.php +++ b/application/ship-simu/main/ships/passenger/class_PassengerShip.php @@ -45,7 +45,7 @@ class PassengerShip extends BaseShip implements ConstructableShip { // Debug message if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) { - $passInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Passagier-Schiff wird erstellt.
\n", + $passInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Passagier-Schiff wird erstellt.", __CLASS__, __LINE__ )); @@ -93,7 +93,7 @@ class PassengerShip extends BaseShip implements ConstructableShip { } // Debug-Meldung ausgeben - $this->getDebugInstance()->output(sprintf("[%s:%d] Es stehen %d Betten vom Kabinen-Typ %s bereit.
\n", + $this->getDebugInstance()->output(sprintf("[%s:%d] Es stehen %d Betten vom Kabinen-Typ %s bereit.", __CLASS__, __LINE__, $total, @@ -102,7 +102,7 @@ class PassengerShip extends BaseShip implements ConstructableShip { } } else { // Keine Kabine! - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %s ist keine Kabine.
\n", + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %s ist keine Kabine.", __CLASS__, __LINE__, $el->getObjectDescription() @@ -110,7 +110,7 @@ class PassengerShip extends BaseShip implements ConstructableShip { } } // END - for - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das %s mit dem Namen %s hat %d Betten.
\n", + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das %s mit dem Namen %s hat %d Betten.", __CLASS__, __LINE__, $this->getObjectDescription(), diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php index c1d6590..9381942 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php @@ -43,7 +43,7 @@ class EconomyCabin extends BaseCabin implements TradeableItem, ConstructableShip $ecoInstance = new EconomyCabin(); // Debug message - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $ecoInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Economy-Class-Kabine wird konstruiert...
\n", + if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $ecoInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Economy-Class-Kabine wird konstruiert...", __CLASS__, __LINE__ )); diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php index cb8627a..52f9b26 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php @@ -43,7 +43,7 @@ class LowCabin extends BaseCabin implements TradeableItem, ConstructableShipPart $lowInstance = new LowCabin(); // Debug message - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $lowInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine 2-Sterne-Kabine wird konstruiert...
\n", + if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $lowInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine 2-Sterne-Kabine wird konstruiert...", __CLASS__, __LINE__ )); diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php index 195ee8f..ac2f38d 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php @@ -43,7 +43,7 @@ class LuxuryCabin extends BaseCabin implements TradeableItem, ConstructableShipP $luxuryInstance = new LuxuryCabin(); // Debug message - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $luxuryInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Luxuskabine wird konstruiert...
\n", + if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $luxuryInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Luxuskabine wird konstruiert...", __CLASS__, __LINE__ )); diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php index 30e573c..c44157e 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php @@ -43,7 +43,7 @@ class PremierCabin extends BaseCabin implements TradeableItem, ConstructableShip $premierInstance = new PremierCabin(); // Debug message - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $premierInstance->getDebugInstance()->output("[PremierCabin:] Eine Premier-Kabine wird konstruiert...
\n"); + if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $premierInstance->getDebugInstance()->output("[PremierCabin:] Eine Premier-Kabine wird konstruiert..."); // Abmasse extrahieren $premierInstance->extractDimensions($dim); diff --git a/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php b/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php index 918f66e..5629ca4 100644 --- a/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php +++ b/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php @@ -43,7 +43,7 @@ class BaseCabinStructure extends BaseStructure { // Kabine hinzufuegen public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $cabinInstance) { - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Kabine %s wird für das Schiff %s konstruiert.
\n", + if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Kabine %s wird für das Schiff %s konstruiert.", __CLASS__, __LINE__, $cabinInstance->getObjectDescription(), @@ -67,7 +67,7 @@ class BaseCabinStructure extends BaseStructure { $this->setDeckInstance($cabinInstance); // Einbaut-Meldung ausgeben - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Kabine %s wurde in das Schiff eingebaut.
\n", + if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Kabine %s wurde in das Schiff eingebaut.", __CLASS__, __LINE__, $cabinInstance->getObjectDescription(), @@ -77,87 +77,46 @@ class BaseCabinStructure extends BaseStructure { // Wrapper fuer setDeckInstance->setPartInstance public final function setDeckInstance ($deck) { - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Wrapper setDeckInstance->setPartInstance erreicht.
\n", - __CLASS__, - __LINE__ - )); parent::setPartInstance($deck); } // Getter-Methode fuer Anzahl Betten public final function getNumBeds () { - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %d Betten angefordert.
\n", - __CLASS__, - __LINE__, - $this->numBeds - )); return $this->numBeds; } // Getter-Methode fuer Anzahl Kabinen public final function getNumCabin () { - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %d Kabine(n) angefordert.
\n", - __CLASS__, - __LINE__, - $this->numCabin - )); return $this->numCabin; } // Setter-Methode fuer Anzahl Betten public final function setNumBeds ($numBeds) { - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %d Betten gesetzt.
\n", - __CLASS__, - __LINE__, - $numBeds - )); $this->numBeds = $numBeds; } // Setter-Methode fuer Anzahl Raeume public final function setNumRooms ($numRooms) { - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %d Raum/Räume gesetzt.
\n", - __CLASS__, - __LINE__, - $numRooms - )); $this->numRooms = $numRooms; } // Setter-Methode fuer Anzahl Kabinen public final function setNumCabin ($numCabin) { - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %d Kabine(n) gesetzt.
\n", - __CLASS__, - __LINE__, - $numCabin - )); $this->numCabin = $numCabin; } // Loesch-Methode fuer Anzahl Betten public final function removeNumBeds() { - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Betten gelöscht.
\n", - __CLASS__, - __LINE__ - )); unset($this->numBeds); } // Loesch-Methode fuer Anzahl Kabinen public final function removeNumCabin() { - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Kabinen gelöscht.
\n", - __CLASS__, - __LINE__ - )); unset($this->numCabin); } // Loesch-Methode fuer Anzahl Raeume public final function removeNumRooms() { - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Räume gelöscht.
\n", - __CLASS__, - __LINE__ - )); unset($this->numRooms); } @@ -177,7 +136,7 @@ class BaseCabinStructure extends BaseStructure { } // Debug-Meldung ausgeben - $this->getDebugInstance()->output(sprintf("[%s:%d] Es exisitieren %d Kabinen vom Typ %s zu je %d Betten. Das sind %d Betten.
\n", + $this->getDebugInstance()->output(sprintf("[%s:%d] Es exisitieren %d Kabinen vom Typ %s zu je %d Betten. Das sind %d Betten.", __CLASS__, __LINE__, $num, diff --git a/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php b/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php index 60ec1c7..d503231 100644 --- a/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php +++ b/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php @@ -36,7 +36,7 @@ class BaseDeckStructure extends BaseStructure { // Deckstruktur dem Schiff hinzufuegen public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $deckInstance) { - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Deck %s wird für das Schiff %s konstruiert.
\n", + if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Deck %s wird für das Schiff %s konstruiert.", __CLASS__, __LINE__, $deckInstance->getObjectDescription(), @@ -50,7 +50,7 @@ class BaseDeckStructure extends BaseStructure { $this->setNumDecks($deckInstance->getNumDecks()); $deckInstance->removeNumDecks(); - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Deck %s wurde in das Schiff %s eingebaut.
\n", + if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Deck %s wurde in das Schiff %s eingebaut.", __CLASS__, __LINE__, $deckInstance->getObjectDescription(), @@ -60,10 +60,6 @@ class BaseDeckStructure extends BaseStructure { // Deckanzahl entfernen public final function removeNumDecks() { - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Decks wurde gelöscht.
\n", - __CLASS__, - __LINE__ - )); unset($this->numDecks); } diff --git a/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php b/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php index 4977d8f..31b2c2c 100644 --- a/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php +++ b/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php @@ -43,7 +43,7 @@ class CarDeck extends BaseDeck implements TradeableItem, ConstructableShipPart { $carInstance = new CarDeck(); // Debug message - if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $carInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Autodeck wird konstruiert...
\n", + if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $carInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Autodeck wird konstruiert...", __CLASS__, __LINE__ )); diff --git a/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php b/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php index 20450f7..c8c1912 100644 --- a/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php +++ b/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php @@ -43,7 +43,7 @@ class TrainDeck extends BaseDeck implements TradeableItem, ConstructableShipPart $trainInstance = new TrainDeck(); // Debug message - if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $trainInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein LKW-Deck wird konstruiert...
\n", + if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $trainInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein LKW-Deck wird konstruiert...", __CLASS__, __LINE__ )); diff --git a/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php b/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php index a20bbc2..198c050 100644 --- a/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php +++ b/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php @@ -44,7 +44,7 @@ class TruckDeck extends BaseDeck implements TradeableItem, ConstructableShipPart $truckInstance = new TruckDeck(); // Debug message - if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $truckInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein LKW-Deck wird konstruiert...
\n", + if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $truckInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein LKW-Deck wird konstruiert...", __CLASS__, __LINE__ )); diff --git a/application/ship-simu/main/structures/extended/upper/class_Bridge.php b/application/ship-simu/main/structures/extended/upper/class_Bridge.php index 1cbad17..032d2d1 100644 --- a/application/ship-simu/main/structures/extended/upper/class_Bridge.php +++ b/application/ship-simu/main/structures/extended/upper/class_Bridge.php @@ -44,7 +44,7 @@ class Bridge extends BaseUpperStructure implements TradeableItem, ConstructableS $bridgeInstance = new Bridge(); // Debug message - if ((defined('DEBUG_MODE')) || (defined('DEBUG_ALL'))) $bridgeInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Brücke wird konstruiert...
\n", + if ((defined('DEBUG_MODE')) || (defined('DEBUG_ALL'))) $bridgeInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Brücke wird konstruiert...", __CLASS__, __LINE__ )); diff --git a/inc/classes/exceptions/helper/class_UserInstanceMissingException.php b/inc/classes/exceptions/helper/class_UserInstanceMissingException.php index ea13f46..f85d694 100644 --- a/inc/classes/exceptions/helper/class_UserInstanceMissingException.php +++ b/inc/classes/exceptions/helper/class_UserInstanceMissingException.php @@ -31,7 +31,7 @@ class UserInstanceMissingException extends FrameworkException { */ public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Registry key %s does not include a class with implemented interface ManageableUser.", + $message = sprintf("[%s:%d] Registry key %s does not include a class with implemented interface Manageable(User|Guest).", $classArray[0]->__toString(), $this->getLine(), $classArray[1] diff --git a/inc/classes/interfaces/mailer/.htaccess b/inc/classes/interfaces/mailer/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/interfaces/mailer/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/interfaces/mailer/class_DeliverableMail.php b/inc/classes/interfaces/mailer/class_DeliverableMail.php new file mode 100644 index 0000000..522dbb9 --- /dev/null +++ b/inc/classes/interfaces/mailer/class_DeliverableMail.php @@ -0,0 +1,28 @@ + + * @version 0.0.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface DeliverableMail extends FrameworkInterface { +} + +// +?> diff --git a/inc/classes/interfaces/user/class_ManageableAccount.php b/inc/classes/interfaces/user/class_ManageableAccount.php new file mode 100644 index 0000000..bf091f8 --- /dev/null +++ b/inc/classes/interfaces/user/class_ManageableAccount.php @@ -0,0 +1,59 @@ + + * @version 0.0.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface ManageableAccount extends FrameworkInterface { + /** + * Determines wether the username exists or not + * + * @return $exists Wether the username exists + */ + function ifUsernameExists (); + + /** + * Determines wether the email exists or not + * + * @return $exists Wether the email exists + */ + function ifEmailAddressExists (); + + /** + * Checks if the supplied password hash in request matches with the stored + * in database. + * + * @param $requestInstance A requestable class instance + * @return $matches Wether the supplied password hash matches + */ + function ifPasswordHashMatches (Requestable $requestInstance); + + /** + * Adds data for later complete update + * + * @param $column Column we want to update + * @param $value New value to store in database + * @return void + */ + function addUpdateData ($column, $value); +} + +// +?> diff --git a/inc/classes/interfaces/user/class_ManageableUser.php b/inc/classes/interfaces/user/class_ManageableUser.php deleted file mode 100644 index 4dafed2..0000000 --- a/inc/classes/interfaces/user/class_ManageableUser.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software - * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -interface ManageableUser extends FrameworkInterface { - /** - * Determines wether the username exists or not - * - * @return $exists Wether the username exists - */ - function ifUsernameExists (); - - /** - * Determines wether the email exists or not - * - * @return $exists Wether the email exists - */ - function ifEmailAddressExists (); - - /** - * Checks if the supplied password hash in request matches with the stored - * in database. - * - * @param $requestInstance A requestable class instance - * @return $matches Wether the supplied password hash matches - */ - function ifPasswordHashMatches (Requestable $requestInstance); - - /** - * Adds data for later complete update - * - * @param $column Column we want to update - * @param $value New value to store in database - * @return void - */ - function addUpdateData ($column, $value); -} - -// -?> diff --git a/inc/classes/interfaces/user/extended/.htaccess b/inc/classes/interfaces/user/extended/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/interfaces/user/extended/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/interfaces/user/extended/class_ManageableGuest.php b/inc/classes/interfaces/user/extended/class_ManageableGuest.php new file mode 100644 index 0000000..2884ea8 --- /dev/null +++ b/inc/classes/interfaces/user/extended/class_ManageableGuest.php @@ -0,0 +1,28 @@ + + * @version 0.0.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface ManageableGuest extends ManageableAccount { +} + +// +?> diff --git a/inc/classes/interfaces/user/extended/class_ManageableUser.php b/inc/classes/interfaces/user/extended/class_ManageableUser.php new file mode 100644 index 0000000..7f4c191 --- /dev/null +++ b/inc/classes/interfaces/user/extended/class_ManageableUser.php @@ -0,0 +1,28 @@ + + * @version 0.0.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface ManageableUser extends ManageableAccount { +} + +// +?> diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 7a738d6..ea3201f 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -199,7 +199,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { if ($this->__toString() != "DestructedObject") { // Debug message if ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) { - $this->getDebugInstance()->output(sprintf("[%s:] Das Objekt %s wird zerstört.
\n", + $this->getDebugInstance()->output(sprintf("[%s:] Das Objekt %s wird zerstört.", __CLASS__, $this->__toString() )); } // END - if @@ -210,7 +210,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $this->resetUniqueID(); } elseif ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) { // Already destructed object - $this->getDebugInstance()->output(sprintf("[%s:] Das Objekt %s wurde bereits zerstört.
\n", + $this->getDebugInstance()->output(sprintf("[%s:] Das Objekt %s wurde bereits zerstört.", __CLASS__, $this->__toString() )); } diff --git a/inc/classes/main/commands/class_ b/inc/classes/main/commands/class_ index 778e7d8..b488683 100644 --- a/inc/classes/main/commands/class_ +++ b/inc/classes/main/commands/class_ @@ -44,8 +44,8 @@ class ???Command extends BaseCommand implements Commandable { /** * Creates an instance of this class * - * @param $resolverInstance An instance of a command resolver class - * @return $commandInstance An instance a prepared command class + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class */ public final static function create???Command (CommandResolver $resolverInstance) { // Get new instance @@ -61,8 +61,8 @@ class ???Command extends BaseCommand implements Commandable { /** * Executes the given command with given request and response objects * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface * @return void */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { diff --git a/inc/classes/main/commands/web/class_WebDoFormCommand.php b/inc/classes/main/commands/web/class_WebDoFormCommand.php index 3dde736..019ddd7 100644 --- a/inc/classes/main/commands/web/class_WebDoFormCommand.php +++ b/inc/classes/main/commands/web/class_WebDoFormCommand.php @@ -44,8 +44,8 @@ class WebDoFormCommand extends BaseCommand implements Commandable { /** * Creates an instance of this class * - * @param $resolverInstance An instance of a command resolver class - * @return $commandInstance An instance a prepared command class + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class */ public final static function createWebDoFormCommand (CommandResolver $resolverInstance) { // Get new instance @@ -61,8 +61,8 @@ class WebDoFormCommand extends BaseCommand implements Commandable { /** * Executes the given command with given request and response objects * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface * @return void */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { diff --git a/inc/classes/main/commands/web/class_WebHomeCommand.php b/inc/classes/main/commands/web/class_WebHomeCommand.php index d04e77a..84ef272 100644 --- a/inc/classes/main/commands/web/class_WebHomeCommand.php +++ b/inc/classes/main/commands/web/class_WebHomeCommand.php @@ -44,8 +44,8 @@ class WebHomeCommand extends BaseCommand implements Commandable { /** * Creates an instance of this class * - * @param $resolverInstance An instance of a command resolver class - * @return $commandInstance An instance a prepared command class + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class */ public final static function createWebHomeCommand (CommandResolver $resolverInstance) { // Get new instance @@ -61,8 +61,8 @@ class WebHomeCommand extends BaseCommand implements Commandable { /** * Executes the given command with given request and response objects * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface * @return void */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { diff --git a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php index 63a86a7..0848cf5 100644 --- a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php @@ -49,8 +49,8 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable { /** * Creates an instance of this class * - * @param $resolverInstance An instance of a command resolver class - * @return $commandInstance An instance a prepared command class + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class */ public final static function createWebLoginAreaCommand (CommandResolver $resolverInstance) { // Get new instance @@ -78,8 +78,8 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable { /** * Executes the given command with given request and response objects * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface * @return void */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { diff --git a/inc/classes/main/commands/web/class_WebLoginCommand.php b/inc/classes/main/commands/web/class_WebLoginCommand.php index 6fadf04..a37949d 100644 --- a/inc/classes/main/commands/web/class_WebLoginCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginCommand.php @@ -44,8 +44,8 @@ class WebLoginCommand extends BaseCommand implements Commandable { /** * Creates an instance of this class * - * @param $resolverInstance An instance of a command resolver class - * @return $commandInstance An instance a prepared command class + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class */ public final static function createWebLoginCommand (CommandResolver $resolverInstance) { // Get new instance @@ -61,8 +61,8 @@ class WebLoginCommand extends BaseCommand implements Commandable { /** * Executes the given command with given request and response objects * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface * @return void */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { diff --git a/inc/classes/main/commands/web/class_WebLoginFailedCommand.php b/inc/classes/main/commands/web/class_WebLoginFailedCommand.php index eead89a..0d1d068 100644 --- a/inc/classes/main/commands/web/class_WebLoginFailedCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginFailedCommand.php @@ -44,8 +44,8 @@ class WebLoginFailedCommand extends BaseCommand implements Commandable { /** * Creates an instance of this class * - * @param $resolverInstance An instance of a command resolver class - * @return $commandInstance An instance a prepared command class + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class */ public final static function createWebLoginFailedCommand (CommandResolver $resolverInstance) { // Get new instance @@ -61,8 +61,8 @@ class WebLoginFailedCommand extends BaseCommand implements Commandable { /** * Executes the given command with given request and response objects * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface * @return void */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { diff --git a/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php b/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php index 3759b5e..cd09a40 100644 --- a/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php +++ b/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php @@ -44,8 +44,8 @@ class WebLogoutDoneCommand extends BaseCommand implements Commandable { /** * Creates an instance of this class * - * @param $resolverInstance An instance of a command resolver class - * @return $commandInstance An instance a prepared command class + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class */ public final static function createWebLogoutDoneCommand (CommandResolver $resolverInstance) { // Get new instance @@ -61,8 +61,8 @@ class WebLogoutDoneCommand extends BaseCommand implements Commandable { /** * Executes the given command with given request and response objects * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface * @return void */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { diff --git a/inc/classes/main/commands/web/class_WebRegisterCommand.php b/inc/classes/main/commands/web/class_WebRegisterCommand.php index f4cc325..bc10daf 100644 --- a/inc/classes/main/commands/web/class_WebRegisterCommand.php +++ b/inc/classes/main/commands/web/class_WebRegisterCommand.php @@ -44,8 +44,8 @@ class WebRegisterCommand extends BaseCommand implements Commandable { /** * Creates an instance of this class * - * @param $resolverInstance An instance of a command resolver class - * @return $commandInstance An instance a prepared command class + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class */ public final static function createWebRegisterCommand (CommandResolver $resolverInstance) { // Get new instance @@ -61,8 +61,8 @@ class WebRegisterCommand extends BaseCommand implements Commandable { /** * Executes the given command with given request and response objects * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface * @return void */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { diff --git a/inc/classes/main/commands/web/class_WebResendLinkCommand.php b/inc/classes/main/commands/web/class_WebResendLinkCommand.php index ba9f9f5..887712e 100644 --- a/inc/classes/main/commands/web/class_WebResendLinkCommand.php +++ b/inc/classes/main/commands/web/class_WebResendLinkCommand.php @@ -44,8 +44,8 @@ class WebResendLinkCommand extends BaseCommand implements Commandable { /** * Creates an instance of this class * - * @param $resolverInstance An instance of a command resolver class - * @return $commandInstance An instance a prepared command class + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class */ public final static function createWebResendLinkCommand (CommandResolver $resolverInstance) { // Get new instance @@ -61,12 +61,28 @@ class WebResendLinkCommand extends BaseCommand implements Commandable { /** * Executes the given command with given request and response objects * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface * @return void */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { - $this->debugInstance(); + // Get a user instance from registry + $userInstance = Registry::getRegistry()->getInstance('user'); + + // Get a mailer class + $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class'); + + // Load the mail template + $mailerInstance->loadTemplate("resend_link"); + + // Add the recipient + $mailerInstance->addRecipientByUser($userInstance); + + // Set subject line from template + $mailerInstance->setSubjectFromTemplate(); + + // Send the email out + $mailerInstance->deliverEmail(); } /** diff --git a/inc/classes/main/console/class_ConsoleTools.php b/inc/classes/main/console/class_ConsoleTools.php index ffd8b8e..eaf60aa 100644 --- a/inc/classes/main/console/class_ConsoleTools.php +++ b/inc/classes/main/console/class_ConsoleTools.php @@ -56,7 +56,7 @@ class ConsoleTools extends BaseFrameworkSystem { // Read the file $hostname = trim($io->readFromFile()); - $helper->getDebugInstance()->output(sprintf("[%s:] Our host name is: %s
\n", + $helper->getDebugInstance()->output(sprintf("[%s:] Our host name is: %s", $helper->__toString(), $hostname )); @@ -71,7 +71,7 @@ class ConsoleTools extends BaseFrameworkSystem { $ip = $ipResolved; // Debug message - $helper->getDebugInstance()->output(sprintf("[%s:] Resolved IP address is: %s
\n", + $helper->getDebugInstance()->output(sprintf("[%s:] Resolved IP address is: %s\n", $helper->__toString(), $ip )); diff --git a/inc/classes/main/debug/class_DebugWebOutput.php b/inc/classes/main/debug/class_DebugWebOutput.php index 48c9aad..9c366b6 100644 --- a/inc/classes/main/debug/class_DebugWebOutput.php +++ b/inc/classes/main/debug/class_DebugWebOutput.php @@ -58,7 +58,9 @@ class DebugWebOutput extends BaseFrameworkSystem implements Debugger, OutputStre * @return void */ public final function outputStream ($output) { - print($output); + // Strip out
+ $output = str_replace("
", "", $output); + print($output."
\n"); } /** diff --git a/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php index c7d060c..b4b37cf 100644 --- a/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php @@ -77,6 +77,9 @@ class UserUnconfirmedVerifierFilter extends BaseFrameworkSystem implements Filte // Stop processing here exit(); } // END - if + + // Add this instance to registry + Registry::getRegistry()->addInstance('user', $userInstance); } } diff --git a/inc/classes/main/mailer/.htaccess b/inc/classes/main/mailer/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/mailer/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/mailer/class_ b/inc/classes/main/mailer/class_ new file mode 100644 index 0000000..2d19163 --- /dev/null +++ b/inc/classes/main/mailer/class_ @@ -0,0 +1,56 @@ + + * @version 0.0.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ???Mailer extends BaseMailer implements DeliverableMail { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set part description + $this->setObjectDescription(""); + + // Create unique ID number + $this->generateUniqueId(); + } + + /** + * Creates an instance of this mailer class + * + * @return $mailerInstance An instance of this mailer class + */ + public final static function create???Mailer () { + // Get a new instance + $mailerInstance = new ???Mailer(); + + // Return the instance + return $mailerInstance; + } +} + +// [EOF] +?> diff --git a/inc/classes/main/mailer/class_BaseMailer.php b/inc/classes/main/mailer/class_BaseMailer.php new file mode 100644 index 0000000..a3ab5a2 --- /dev/null +++ b/inc/classes/main/mailer/class_BaseMailer.php @@ -0,0 +1,42 @@ + + * @version 0.0.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseMailer extends BaseFrameworkSystem { + /** + * Protected constructor + * + * @param $className Name of the class + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } +} + +// [EOF] +?> diff --git a/inc/classes/main/mailer/debug/.htaccess b/inc/classes/main/mailer/debug/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/mailer/debug/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/mailer/debug/class_DebugMailer.php b/inc/classes/main/mailer/debug/class_DebugMailer.php new file mode 100644 index 0000000..5c2049f --- /dev/null +++ b/inc/classes/main/mailer/debug/class_DebugMailer.php @@ -0,0 +1,56 @@ + + * @version 0.0.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class DebugMailer extends BaseMailer implements DeliverableMail { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set part description + $this->setObjectDescription("A mailer for debugging purposes"); + + // Create unique ID number + $this->generateUniqueId(); + } + + /** + * Creates an instance of this mailer class + * + * @return $mailerInstance An instance of this mailer class + */ + public final static function createDebugMailer () { + // Get a new instance + $mailerInstance = new DebugMailer(); + + // Return the instance + return $mailerInstance; + } +} + +// [EOF] +?> diff --git a/inc/classes/main/user/class_Guest.php b/inc/classes/main/user/class_Guest.php index d07317a..aa8878e 100644 --- a/inc/classes/main/user/class_Guest.php +++ b/inc/classes/main/user/class_Guest.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class Guest extends BaseFrameworkSystem implements ManageableUser, Registerable { +class Guest extends BaseFrameworkSystem implements ManageableGuest, Registerable { /** * Instance of the database result */ diff --git a/inc/config.php b/inc/config.php index 7ac8fa9..68f7d7c 100644 --- a/inc/config.php +++ b/inc/config.php @@ -194,7 +194,7 @@ $cfg->setConfigEntry('username_verifier_class', "UserNameVerifierFilter"); // CFG: EMAIL-VERIFIER $cfg->setConfigEntry('email_verifier_class', "EmailVerifierFilter"); -// CFG: PASSWORD-VERIFIER +// CFG: PASSWORD-VERIFIER-CLASS $cfg->setConfigEntry('password_verifier_class', "PasswordVerifierFilter"); // CFG: EMAIL-CHANGE-CLASS @@ -212,21 +212,24 @@ $cfg->setConfigEntry('user_status_class', "UserStatusVerifierFilter"); // CFG: USER-UNCONFIRMED-CLASS $cfg->setConfigEntry('user_unconfirmed_class', "UserUnconfirmedVerifierFilter"); -// CFG: CRYPTO-HELPER +// CFG: CRYPTO-CLASS $cfg->setConfigEntry('crypto_class', "CryptoHelper"); // CFG: RNG-CLASS $cfg->setConfigEntry('rng_class', "RandomNumberGenerator"); -// CFG: USER-DB-WRAPPER +// CFG: USER-DB-WRAPPER-CLASS $cfg->setConfigEntry('user_db_wrapper_class', "UserDatabaseWrapper"); -// CFG: NEWS-DB-WRAPPER +// CFG: NEWS-DB-WRAPPER-CLASS $cfg->setConfigEntry('news_db_wrapper_class', "NewsDatabaseWrapper"); -// CFG: WEB-CMD-RESOLVER +// CFG: WEB-CMD-RESOLVER-CLASS $cfg->setConfigEntry('web_cmd_resolver_class', "WebCommandResolver"); +// CFG: MAILER-CLASS +$cfg->setConfigEntry('mailer_class', "DebugMailer"); + // CFG: MATH-PRIME $cfg->setConfigEntry('math_prime', 591623); diff --git a/inc/database/lib-local.php b/inc/database/lib-local.php index 613d6d2..3c85645 100644 --- a/inc/database/lib-local.php +++ b/inc/database/lib-local.php @@ -26,23 +26,23 @@ try { $layer = LocalFileDatabase::createLocalFileDatabase(PATH . FrameworkConfiguration::getInstance()->readConfig('local_db_path'), FileIoHandler::getInstance()); } catch (SavePathIsEmptyException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s
\n", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", $e->getMessage() )); } catch (SavePathNotFoundException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s
\n", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", $e->getMessage() )); } catch (SavePathIsNoDirectoryException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s
\n", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", $e->getMessage() )); } catch (SavePathReadProtectedException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s
\n", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", $e->getMessage() )); } catch (SavePathWriteProtectedException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s
\n", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", $e->getMessage() )); } diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 1091a5b..f8b1718 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -27,11 +27,11 @@ print (basename(__FILE__).": Init completed.\n\n"); /** * A test case for the configuration sub system * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @link http://www.ship-simu.org * @see http://www.phpunit.de * * This program is free software: you can redistribute it and/or modify diff --git a/tests/RegistryTest.php b/tests/RegistryTest.php index 4efbbb0..f83c6d0 100644 --- a/tests/RegistryTest.php +++ b/tests/RegistryTest.php @@ -27,11 +27,11 @@ print (basename(__FILE__).": Init completed.\n\n"); /** * A test case for the registry * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @link http://www.ship-simu.org * @see http://www.phpunit.de * * This program is free software: you can redistribute it and/or modify @@ -58,7 +58,7 @@ class RegistryTest extends PHPUnit_Framework_TestCase { $registryInstance = Registry::getRegistry(); // Create a User instance - $userInstance = User::createUserByEmail("webmaster@mxchange.org"); + $userInstance = User::createUserByEmail("webmaster@ship-simu.org"); // Now store the instance in the registry $registryInstance->addInstance('user', $userInstance); @@ -82,7 +82,7 @@ class RegistryTest extends PHPUnit_Framework_TestCase { $userInstance = $registryInstance->getInstance('user'); // Compare both unique keys - $testPassed = ($userInstance instanceof ManageableUser); + $testPassed = ($userInstance instanceof ManageableAccount); // Test passed? if (!$testPassed) { diff --git a/tests/RequestTest.php b/tests/RequestTest.php index c4edab0..a257260 100644 --- a/tests/RequestTest.php +++ b/tests/RequestTest.php @@ -28,11 +28,11 @@ print (basename(__FILE__).": Init completed.\n\n"); * A test case for faked HTTP requests. This is faked because we *set* * $_REQUEST here. This should be made better in PHP6... :( * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @link http://www.ship-simu.org * @see http://www.phpunit.de * * This program is free software: you can redistribute it and/or modify @@ -71,6 +71,32 @@ class RequestTest extends PHPUnit_Framework_TestCase { )); } } + + /** + * Now fake a request array and try the test on it again + * + * @return void + */ + public function testFakeRequestElement () { + // Fake the request here + $_REQUEST = array('test_key' => "test_value"); + + // Again get an instance + $requestInstance = HttpRequest::createHttpRequest(); + + // Get the element + $testValue = $requestInstance->getRequestElement('test_key'); + + // Is it the same? + if ($testValue !== "test_value") { + // Something went wrong + $this->fail(sprintf("[%s] Unexpected value %s (%s) from test key received.", + $requestInstance->__toString(), + $testValue, + gettype($testValue) + )); + } + } } ?> diff --git a/tests/Test.php b/tests/Test.php index 284f9b2..6f2ecd5 100644 --- a/tests/Test.php +++ b/tests/Test.php @@ -28,11 +28,11 @@ die("You need to remove this line (".__LINE__.") and implement this test!\n"); /** * A test case for * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @link http://www.ship-simu.org * @see http://www.phpunit.de * * This program is free software: you can redistribute it and/or modify