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
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
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
// Remove min/max ages
public final function removeMinMaxAge () {
- if (defined('DEBUG_PERSONELL')) $this->getDebugInstance()->output(sprintf("[%s:%d] Minimum-/Maximum-Alter entfernt.<br />\n",
- __CLASS__,
- __LINE__
- ));
unset($this->MIN_AGE);
unset($this->MAX_AGE);
}
// Setter-Methode fuer Laenge
public final function setLength ($length) {
- if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] <strong>%dm</strong> Länge gesetzt.<br />\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:] <strong>%dm</strong> Breite gesetzt.<br />\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:] <strong>%dm</strong> Höhe gesetzt.<br />\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.<br />\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.<br />\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.<br />\n",
- $this->__toString()
- ));
return $this->height;
}
// 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.<br />\n",
- $this->__toString()
- ));
- } else {
- // Leere Instanz kann entfernt werden
- if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] partInstance wurde entfernt.<br />\n",
- $this->__toString()
- ));
- unset($this->partInstance);
- }
+ unset($this->partInstance);
}
// Prueft ob all Umberechnungsfaktoren gesetzt sind
$this->currShip = $shipInstance;
$this->currPart = $partInstance;
- if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Maschinenraum mit Motor <strong>%s</strong> wird fuer das Schiff <strong>%s</strong> konstruiert.<br />\n",
+ if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Maschinenraum mit Motor <strong>%s</strong> wird fuer das Schiff <strong>%s</strong> konstruiert.",
$this->__toString(),
$this->getCurrPart()->getObjectDescription(),
$this->currShip->getShipName()
// 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 <strong>%s</strong> vom Typ <strong>%s</strong> passt in das Schiff <strong>%s</strong> hinein.<br />\n",
+ if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Das Schiffsteil <strong>%s</strong> vom Typ <strong>%s</strong> passt in das Schiff <strong>%s</strong> hinein.",
$this->__toString(),
$this->getCurrPart()->getObjectDescription(),
$this->getCurrPart()->__toString(),
// 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 <strong>%s</strong> passt in das Schiff <strong>%s</strong> hinein.<br />\n",
+ if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Das Schiffsteil <strong>%s</strong> passt in das Schiff <strong>%s</strong> hinein.",
$this->__toString(),
$this->getObjectDescription(),
$this->currShip->getShipName()
// Existiert ein Schiffsteil?
if (!is_null($this->currPart)) {
// Debug-Meldung ausgeben
- if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Schiffsteil <strong>%s</strong> gefunden.<br />\n",
+ if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Schiffsteil <strong>%s</strong> gefunden.",
$this->getCurrPart()->realClass,
$this->getCurrPart()->getObjectDescription()
));
// Array fuer Umrechnungstabelle entfernen
public final function removeResizeFactorArray () {
- if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] removeResizeFactor erreicht.<br />\n",
- $this->__toString()
- ));
unset($this->resizeFactorArray);
}
* @return void
*/
public final function removeCurrShip () {
- if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] removeCurrShip erreicht.<br />\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.<br />\n",
- $this->__toString()
- ));
unset($this->currPart);
}
// Breite entfernen
public final function removeWidth () {
- if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Breite entfernt.<br />\n",
- $this->__toString()
- ));
unset($this->width);
}
// Hoehe entfernen
public final function removeHeight () {
- if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Höhe entfernt.<br />\n",
- $this->__toString()
- ));
unset($this->height);
}
// Laenge entfernen
public final function removeLength () {
- if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Länge entfernt.<br />\n",
- $this->__toString()
- ));
unset($this->length);
}
// Tiefgang entfernen
public final function removeDraught () {
- if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Tiefgang entfernt.<br />\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)<br />\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 <strong>%s</strong>=<strong>%s</strong> gesetzt.<br />\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.<br />\n",
- $this->__toString()
- ));
return (
(
( // Already defined ship messurings
// Kontrolliert, ob die Abmasse Maschinenraum->Schiff stimmen
public function isNewSizeValid () {
- if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] isNewSizeValid erreicht.<br />\n",
- $this->__toString()
- ));
return (
( // Already defined ship messurings
($this->newWidth < $this->currShip->getWidth())
// Masse extrahieren
public function extractDimensions ($dim) {
- if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] extractDimensions erreicht für <strong>%s</strong>.<br />\n",
- $this->__toString(),
- $this->getObjectDescription()
- ));
-
// Abmasse setzen
if ((isset($dim)) && (is_array($dim)) && (count($dim) == 3)) {
// Abmasse aus Array holen
// Debug message
if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) {
- $merchantInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Händler <strong>%s</strong> wird angelegt und soll sich am <strong>%s</strong> niederlassen.<br />\n",
+ $merchantInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Händler <strong>%s</strong> wird angelegt und soll sich am <strong>%s</strong> niederlassen.",
__CLASS__,
__LINE__,
$merchantName,
// Initialize pricing list
private function createPriceList () {
- if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händler <strong>%s</strong> erhält eine leere Preisliste.<br />\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 <strong>%s</strong> ist nun bekannt.<br />\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 <strong>%s</strong> wird verlangt.<br />\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 <strong>%s</strong> lässt sich am <strong>%s</strong> nieder.<br />\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 <strong>%s</strong> hat sich am <strong>%s</strong> niedergelassen.<br />\n",
- __CLASS__,
- __LINE__,
- $this->getMerchantName(),
- $harborInstance->getHarborName()
- ));
return $this->harborInstance;
}
$price = (float) $price;
// Debug message
- if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händler <strong>%s</strong> kann nun das Schiffsteil <strong>%s</strong> "<strong>%s</strong>" zu <strong>%s</strong> verkaufen.<br />\n",
+ if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händler <strong>%s</strong> kann nun das Schiffsteil <strong>%s</strong> "<strong>%s</strong>" zu <strong>%s</strong> verkaufen.",
__CLASS__,
__LINE__,
$this->getMerchantName(),
$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 <strong>%s</strong> mit der <strong>%s</strong> <strong>%s</strong> erstellt.<br />\n",
+ if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $contractInstance->getDebugInstance()->output(sprintf("[%s:%d] Neuer Bauvertrag wird für das Schiff <strong>%s</strong> mit der <strong>%s</strong> <strong>%s</strong> erstellt.",
__CLASS__,
__LINE__,
$shipName,
// 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 <strong>%s</strong> wird in den Bauvertrag aufgenommen.<br />\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 <strong>%s</strong> heissen.<br />\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 <strong>%s</strong> angefordert.<br />\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.<br />\n",
- __CLASS__,
- __LINE__
- ));
return $this->shipInstance;
}
$parentPart = (string) $parentPart;
// Debug message
- if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiffsteil <strong>%s</strong> wird zusammen mit dem Konstruktionsteil <strong>%s</strong> in den Bauvertrag aufgenommen.<br />\n",
+ if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiffsteil <strong>%s</strong> wird zusammen mit dem Konstruktionsteil <strong>%s</strong> in den Bauvertrag aufgenommen.",
__CLASS__,
__LINE__,
$shipPart,
));
// Debug message
- if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Versuche ein Schiffsteil in den Bauvertrag aufzunehmen.<br />\n",
+ if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Versuche ein Schiffsteil in den Bauvertrag aufzunehmen.",
__CLASS__,
__LINE__
));
$price = $this->getMerchantInstance()->getPriceFromList($partInstance);
// Final debug message
- if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] <strong>%s</strong> kostet <strong>%s</strong>.<br />\n",
+ if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] <strong>%s</strong> kostet <strong>%s</strong>.",
__CLASS__,
__LINE__,
$partInstance->getObjectDescription(),
$partInstance->setPrice($price);
// Final debug message
- if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] <strong>%s</strong> wurde in den Bauvertrag aufgenommen.<br />\n",
+ if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] <strong>%s</strong> wurde in den Bauvertrag aufgenommen.",
__CLASS__,
__LINE__,
$partInstance->getObjectDescription()
if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) {
if ($partnerInstance->equals($partyInstance)) {
// With itself
- $this->getDebugInstance()->output(sprintf("[%s:%d] Die <strong>%s</strong> <em><strong>%s</strong></em> stimmt einem Bauvertrag über das <strong>%s</strong> <em><strong>%s</strong></em> zu.<br />\n",
+ $this->getDebugInstance()->output(sprintf("[%s:%d] Die <strong>%s</strong> <em><strong>%s</strong></em> stimmt einem Bauvertrag über das <strong>%s</strong> <em><strong>%s</strong></em> zu.",
__CLASS__,
__LINE__,
$partnerInstance->getObjectDescription(),
));
} else {
// Other contract party
- $this->getDebugInstance()->output(sprintf("[%s:%d] Die <strong>%s</strong> <em><strong>%s</strong></em> geht mit der <strong>%s</strong> <em><strong>%s</strong></em> einen Bauvertrag über das <strong>%s</strong> <em><strong>%s</strong></em> ein.<br />\n",
+ $this->getDebugInstance()->output(sprintf("[%s:%d] Die <strong>%s</strong> <em><strong>%s</strong></em> geht mit der <strong>%s</strong> <em><strong>%s</strong></em> einen Bauvertrag über das <strong>%s</strong> <em><strong>%s</strong></em> ein.",
__CLASS__,
__LINE__,
$partnerInstance->getObjectDescription(),
// Get new instance
$companyInstance = new ShippingCompany();
- if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $companyInstance->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> wird gegründet.<br />\n",
+ if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $companyInstance->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> wird gegründet.",
__CLASS__,
__LINE__,
$companyName
// Angestellten-Liste erstellen
private function createEmployeeList () {
- if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> erhält eine Angestelltenliste.<br />\n",
+ if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> erhält eine Angestelltenliste.",
__CLASS__,
__LINE__,
$this->getCompanyName()
// Werftenliste erstellen
public function createShipyardList () {
- if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> erhält eine Werftsliste.<br />\n",
+ if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> erhält eine Werftsliste.",
__CLASS__,
__LINE__,
$this->getCompanyName()
// Auftragsliste erstellen
public function createContractList () {
- if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> erhält eine Auftragsliste.<br />\n",
+ if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> erhält eine Auftragsliste.",
__CLASS__,
__LINE__,
$this->getCompanyName()
// 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 <strong>%s</strong> baut im <strong>%s</strong> eine Werft <strong>%s</strong>.<br />\n",
+ if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> baut im <strong>%s</strong> eine Werft <strong>%s</strong>.",
__CLASS__,
__LINE__,
$this->getCompanyName(),
// 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 <strong>%s</strong> ist von <strong>%s %s</strong> gegründet worden.<br />\n",
- __CLASS__,
- __LINE__,
- $this->getCompanyName(),
- $founderInstance->getSurname(),
- $founderInstance->getFamily()
- ));
$this->founderInstance = $founderInstance;
}
// 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] <strong>%s %s</strong> tritt der Reederei <strong>%s</strong> als <strong>%s</strong> bei und erhält ein Gehalt von <strong>%s</strong>.<br />\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 <strong>%s</strong> erhält die Werft <strong>%s</strong> hinzugefügt.<br />\n",
- __CLASS__,
- __LINE__,
- $this->getCompanyName(),
- $shipyardInstance->getShipyardName()
- ));
$this->shipyardList->append($shipyardInstance);
}
$amount = (int) $amount;
// Debug-Meldung ausgeben
- if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> stellt per Zufall <strong>%d</strong> neue Mitarbeiter ein.<br />\n",
+ if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> stellt per Zufall <strong>%d</strong> neue Mitarbeiter ein.",
__CLASS__,
__LINE__,
$this->getCompanyName(),
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
$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 <strong>%s</strong> stellt den/die Angestellte(n) <strong>%s %s</strong> ein.<br />\n",
+ if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> stellt den/die Angestellte(n) <strong>%s %s</strong> ein.",
__CLASS__,
__LINE__,
$this->getCompanyName(),
$personellInstance->resetCache();
// Debug-Meldung ausgeben
- if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> hat per Zufall <strong>%d</strong> neue Mitarbeiter eingestellt.<br />\n",
+ if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> hat per Zufall <strong>%d</strong> neue Mitarbeiter eingestellt.",
__CLASS__,
__LINE__,
$this->getCompanyName(),
// 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 <strong>%s</strong> verteilt alle ihre <strong>%d</strong> Mitarbeiter auf alle <strong>%d</strong> Werft(en).<br />\n",
+ if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> verteilt alle ihre <strong>%d</strong> Mitarbeiter auf alle <strong>%d</strong> Werft(en).",
__CLASS__,
__LINE__,
$this->getCompanyName(),
$total = $this->employeeList->count();
// Debug message
- if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> hat <strong>%d</strong> Mitarbeiter.<br />\n",
+ if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> hat <strong>%d</strong> Mitarbeiter.",
__CLASS__,
__LINE__,
$this->getCompanyName(),
// 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 <strong>%s</strong> werden die Anzahl der Werften in allen Häfen ermittelt.<br />\n",
+ if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Für die Reederei <strong>%s</strong> werden die Anzahl der Werften in allen Häfen ermittelt.",
__CLASS__,
__LINE__,
$this->getCompanyName()
$total = $this->shipyardList->count();
// Debug message
- if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> hat <strong>%d</strong> Werft(en).<br />\n",
+ if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> hat <strong>%d</strong> Werft(en).",
__CLASS__,
__LINE__,
$this->getCompanyName(),
));
// Debug message
- if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> baut in allen Werften bald Schiffe vom Typ <strong>%s</strong>.<br />\n",
+ if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> baut in allen Werften bald Schiffe vom Typ <strong>%s</strong>.",
__CLASS__,
__LINE__,
$this->getCompanyName(),
// 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 <strong>%s</strong> prüft den Bauauftrag der <strong>%s</strong>.<br />\n",
+ if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> prüft den Bauauftrag der <strong>%s</strong>.",
__CLASS__,
__LINE__,
$this->getCompanyName(),
$shipType = $shipInstance->__toString();
// Debug message
- if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> prüft, ob die <strong>%s</strong> (Typ:<strong>%s</strong>) gebaut werden kann.<br />\n",
+ if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> prüft, ob die <strong>%s</strong> (Typ:<strong>%s</strong>) gebaut werden kann.",
__CLASS__,
__LINE__,
$this->getCompanyName(),
$shipType = (string) $shipType;
// Debug message
- if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> fragt alle Werften ab, ob diese Schiffe vom Typ <strong>%s</strong> bauen können.<br />\n",
+ if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> fragt alle Werften ab, ob diese Schiffe vom Typ <strong>%s</strong> bauen können.",
__CLASS__,
__LINE__,
$this->getCompanyName(),
}
// Debug message
- if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> hat die Suche nach einer Werft beendet, die Schiffe vom Typ <strong>%s</strong> bauen kann.<br />\n",
+ if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> hat die Suche nach einer Werft beendet, die Schiffe vom Typ <strong>%s</strong> bauen kann.",
__CLASS__,
__LINE__,
$this->getCompanyName(),
// 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 <strong>%s</strong> erstellt einen Bauauftrag für ein <strong>%s</strong> mit dem Namen <strong>%s</strong>.<br />\n",
+ if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> erstellt einen Bauauftrag für ein <strong>%s</strong> mit dem Namen <strong>%s</strong>.",
__CLASS__,
__LINE__,
$this->getCompanyName(),
// 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 <strong>%s</strong> erteilt an sich selbst einen Bauauftrag für das <strong>%s</strong> "<strong>%s</strong>".<br />\n",
+ if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> erteilt an sich selbst einen Bauauftrag für das <strong>%s</strong> "<strong>%s</strong>".",
__CLASS__,
__LINE__,
$this->getCompanyName(),
));
} else {
// Other external company
- if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> unterzeichnet einen Bauauftrag für das <strong>%s</strong> "<strong>%s</strong>" mit der <strong>%s</strong>.<br />\n",
+ if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> unterzeichnet einen Bauauftrag für das <strong>%s</strong> "<strong>%s</strong>" mit der <strong>%s</strong>.",
__CLASS__,
__LINE__,
$this->getCompanyName(),
$harborInstance = new Harbor();
// Debug message
- if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $harborInstance->getDebugInstance()->output(sprintf("[Harbor:] Der Hafen <strong>%s</strong> wird konstruiert.<br />\n", $harborName));
+ if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $harborInstance->getDebugInstance()->output(sprintf("[Harbor:] Der Hafen <strong>%s</strong> wird konstruiert.", $harborName));
// Hafenname setzen
$harborInstance->setHarborName($harborName);
$harborInstance->createshipyardList();
// Debug-Meldung ausgeben
- if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $harborInstance->getDebugInstance()->output(sprintf("[Harbor:] Der Hafen <strong>%s</strong> ist jetzt fertig gebaut.<br />\n", $harborName));
+ if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $harborInstance->getDebugInstance()->output(sprintf("[Harbor:] Der Hafen <strong>%s</strong> ist jetzt fertig gebaut.", $harborName));
// Instanz zurueckliefern
return $harborInstance;
// 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 <strong>%s</strong> erstellt.<br />\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 <strong>%s</strong>.<br />\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 <strong>%s</strong> wurde angefordert.<br />\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 <strong>%s</strong> wird im Hafen <strong>%s</strong> gebaut.<br />\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 <strong>%s</strong> wird im Hafen <strong>%s</strong> gebaut.<br />\n",
- $shipyardName, $this->getHarborName()
- ));
-
// Werft generieren und in die Werftliste aufnehmen
$this->shipyardList->append(Shipyard::createShipyard($this, $shipyardName));
}
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;
$shipyardInstance = new Shipyard();
// Debug message
- if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Werft mit dem Namen <strong>%s</strong> wird im Hafen <strong>%s</strong> konstruiert.<br />\n",
+ if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Werft mit dem Namen <strong>%s</strong> wird im Hafen <strong>%s</strong> konstruiert.",
__CLASS__,
__LINE__,
$shipyardName,
$shipyardInstance->removeSystemArray();
// Debug-Meldung
- if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->getDebugInstance()->output(sprintf("[%s:%d] Die Werft <strong>%s</strong> wurde gebaut.<br />\n",
+ if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->getDebugInstance()->output(sprintf("[%s:%d] Die Werft <strong>%s</strong> wurde gebaut.",
__CLASS__,
__LINE__,
$shipyardName
// Create staff list
private function createStaffList () {
- if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft <strong>%s</strong> erhält eine Arbeiterliste.<br />\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 <strong>%s</strong> erhält eine Typenliste.<br />\n",
- __CLASS__,
- __LINE__,
- $this->getShipyardName()
- ));
$this->shipTypeList = new FrameworkArrayObject("FakedShipTypeList");
}
$shipType = (string) $shipType;
// Debug message
- if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft <strong>%s</strong> kann bald Schiffe vom Typ <strong>%s</strong> bauen.<br />\n",
+ if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft <strong>%s</strong> kann bald Schiffe vom Typ <strong>%s</strong> bauen.",
__CLASS__,
__LINE__,
$this->getShipyardName(),
$shipType = (string) $shipType;
// Debug message
- if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft <strong>%s</strong> prüft, ob Schiffe vom Typ <strong>%s</strong> baubar sind.<br />\n",
+ if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft <strong>%s</strong> prüft, ob Schiffe vom Typ <strong>%s</strong> baubar sind.",
__CLASS__,
__LINE__,
$this->getShipyardName(),
}
// Debug message
- if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft <strong>%s</strong> hat die Suche nach dem Schiffstyp <strong>%s</strong> abgeschlossen.<br />\n",
+ if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft <strong>%s</strong> hat die Suche nach dem Schiffstyp <strong>%s</strong> abgeschlossen.",
__CLASS__,
__LINE__,
$this->getShipyardName(),
// 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 <strong>%d</strong> PS gesetzt.<br />\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 <strong>%d</strong> Nocken gesetzt.<br />\n",
- __CLASS__,
- __LINE__,
- $cams
- ));
$this->numCams = (int) $cams;
}
$motorInstance = new Motor();
// Debug message
- if ((defined('DEBUG_DRIVE')) || (defined('DEBUG_ALL'))) $motorInstance->getDebugInstance()->output(sprintf("[%s:%d] Motor <strong>%s</strong> wird gebaut...<br />\n",
+ if ((defined('DEBUG_DRIVE')) || (defined('DEBUG_ALL'))) $motorInstance->getDebugInstance()->output(sprintf("[%s:%d] Motor <strong>%s</strong> wird gebaut...",
__CLASS__,
__LINE__,
$descr
$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
$roomInstance = new MaschineRoom();
// Debug message
- if ((defined('DEBUG_MODE')) || (defined('DEBUG_ALL'))) $roomInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Maschinenraum wird konstruiert.<br />\n",
+ if ((defined('DEBUG_MODE')) || (defined('DEBUG_ALL'))) $roomInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Maschinenraum wird konstruiert.",
__CLASS__,
__LINE__
));
$personellInstance = new SimulatorPersonell();
// Debug message
- if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $personellInstance->getDebugInstance()->output(sprintf("[%s:%d] Es werden <strong>%d</strong> Personal bereitgestellt.<br />\n",
+ if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $personellInstance->getDebugInstance()->output(sprintf("[%s:%d] Es werden <strong>%d</strong> Personal bereitgestellt.",
__CLASS__,
__LINE__,
$amountPersonell
}
// Debug message
- if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $personellInstance->getDebugInstance()->output(sprintf("[%s:%d] <strong>%d</strong> Personal bereitgestellt.<br />\n",
+ if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $personellInstance->getDebugInstance()->output(sprintf("[%s:%d] <strong>%d</strong> Personal bereitgestellt.",
__CLASS__,
__LINE__,
$amountPersonell
// 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.<br />\n",
- __CLASS__,
- __LINE__
- ));
$this->personellList = new FrameworkArrayObject("FakedPersonellList");
} else {
throw new PersonellListAlreadyCreatedException($this, self::EXCEPTION_DIMENSION_ARRAY_INVALID);
// Remove the personell list
private function removePersonellList () {
- if (defined('DEBUG_PERSONELL')) $this->getDebugInstance()->output(sprintf("[%s:%d] Personell-Liste entfernt.<br />\n",
- __CLASS__,
- __LINE__
- ));
unset($this->personellList);
}
// 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.<br />\n",
+ if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Gecachte Liste wird verwendet.",
__CLASS__,
__LINE__
));
}
// Output debug message
- if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Personalliste wird nach Kriterien durchsucht...<br />\n",
+ if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Personalliste wird nach Kriterien durchsucht...",
__CLASS__,
__LINE__
));
* @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.<br />\n",
- __CLASS__,
- __LINE__
- ));
-
// Get a temporary list
$list = $this->getSpecialPersonellList(false);
* @return void
*/
private function removeCache () {
- if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Cache-Attribute entfernt.<br />\n",
- __CLASS__,
- __LINE__
- ));
-
// Remove cache data
unset($this->cacheList);
unset($this->cacheCond);
* @return void
*/
public function resetCache () {
- if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Cache-Liste zurückgesetzt.<br />\n",
- __CLASS__,
- __LINE__
- ));
$this->setAllCacheList(null);
$this->setCacheCond("");
}
// Debug message
if (((defined('DEBUG_COMPANY_EMPLOYEE')) && (defined('DEBUG_PERSONELL'))) || (defined('DEBUG_ALL'))) {
- $personellInstance->getDebugInstance()->output(sprintf("[%s:%d] Der/Die Angestellte <strong>%s %s</strong> wird angelegt.<br />\n",
+ $personellInstance->getDebugInstance()->output(sprintf("[%s:%d] Der/Die Angestellte <strong>%s %s</strong> wird angelegt.",
__CLASS__,
__LINE__,
$surname,
// 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.<br />\n",
- __CLASS__,
- __LINE__
- ));
- }
unset($this->employeeList);
}
}
// 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 <strong>%s</strong> erhält ein neues Schiffsteil (%s).<br />\n",
+ if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> erhält ein neues Schiffsteil (%s).",
__CLASS__,
__LINE__,
$this->getShipName(),
try {
$partInstance->addShipPartToShip($this, $buildInstance);
} catch (MotorShipMismatchException $e) {
- if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keinen Motor erhalten! Grund: <strong>%s</strong><br />\n",
+ if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keinen Motor erhalten! Grund: <strong>%s</strong>",
__CLASS__,
__LINE__,
$this->getShipName(),
));
return false;
} catch (RoomShipMismatchException $e) {
- if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keinen Maschinenraum erhalten! Grund: <strong>%s</strong><br />\n",
+ if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keinen Maschinenraum erhalten! Grund: <strong>%s</strong>",
__CLASS__,
__LINE__,
$this->getShipName(),
return false;
} catch (StructureShipMismatchException $e) {
- if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keine Aufbauten erhalten! Grund: <strong>%s</strong><br />\n",
+ if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keine Aufbauten erhalten! Grund: <strong>%s</strong>",
__CLASS__,
__LINE__,
$this->getShipName(),
));
return false;
} catch (CabinShipMismatchException $e) {
- if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keine Kabine erhalten! Grund: <strong>%s</strong><br />\n",
+ if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keine Kabine erhalten! Grund: <strong>%s</strong>",
__CLASS__,
__LINE__,
$this->getShipName(),
));
return false;
} catch (DeckShipMismatchException $e) {
- if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat kein Deck erhalten! Grund: <strong>%s</strong><br />\n",
+ if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat kein Deck erhalten! Grund: <strong>%s</strong>",
__CLASS__,
__LINE__,
$this->getShipName(),
$this->structures->append($partInstance);
// Debug-Meldung ausgeben
- if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat das Schiffsteil <strong>%s</strong> eingebaut bekommen.<br />\n",
+ if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat das Schiffsteil <strong>%s</strong> eingebaut bekommen.",
__CLASS__,
__LINE__,
$this->getShipName(),
// STUB: Getter-Methode Anzahl Betten
public function calcTotalBeds () {
- $this->getDebugInstance()->output("[%s:%d] Stub! Anzahl Betten erreicht.<br />\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 <strong>%s</strong> wird auf den Namen <strong>%s</strong> getauft.<br />\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 <strong>%s</strong> ist auf den Namen <strong>%s</strong> getauft worden.<br />\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 <strong>%s</strong> mit dem Namen <strong>%s</strong> hat einen Tiefgang von <strong>%sm</strong>.<br />\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 <strong>%s</strong> wurde angefordert.<br />\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 <strong>%s</strong> mit dem Namen <strong>%s</strong> hat <strong>%s</strong> Anker.<br />\n",
- __CLASS__,
- __LINE__,
- $this->__toString(),
- $this->shipName,
- $numAnchor
- ));
$this->numAnchor = (int) $numAnchor;
}
}
// Debug message
if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) {
- $passInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Passagier-Schiff wird erstellt.<br />\n",
+ $passInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Passagier-Schiff wird erstellt.",
__CLASS__,
__LINE__
));
}
// Debug-Meldung ausgeben
- $this->getDebugInstance()->output(sprintf("[%s:%d] Es stehen <strong>%d</strong> Betten vom Kabinen-Typ <strong>%s</strong> bereit.<br />\n",
+ $this->getDebugInstance()->output(sprintf("[%s:%d] Es stehen <strong>%d</strong> Betten vom Kabinen-Typ <strong>%s</strong> bereit.",
__CLASS__,
__LINE__,
$total,
}
} else {
// Keine Kabine!
- if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] <strong>%s</strong> ist keine Kabine.<br />\n",
+ if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] <strong>%s</strong> ist keine Kabine.",
__CLASS__,
__LINE__,
$el->getObjectDescription()
}
} // END - for
- if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das <strong>%s</strong> mit dem Namen <strong>%s</strong> hat <strong>%d</strong> Betten.<br />\n",
+ if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das <strong>%s</strong> mit dem Namen <strong>%s</strong> hat <strong>%d</strong> Betten.",
__CLASS__,
__LINE__,
$this->getObjectDescription(),
$ecoInstance = new EconomyCabin();
// Debug message
- if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $ecoInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Economy-Class-Kabine wird konstruiert...<br />\n",
+ if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $ecoInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Economy-Class-Kabine wird konstruiert...",
__CLASS__,
__LINE__
));
$lowInstance = new LowCabin();
// Debug message
- if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $lowInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine 2-Sterne-Kabine wird konstruiert...<br />\n",
+ if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $lowInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine 2-Sterne-Kabine wird konstruiert...",
__CLASS__,
__LINE__
));
$luxuryInstance = new LuxuryCabin();
// Debug message
- if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $luxuryInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Luxuskabine wird konstruiert...<br />\n",
+ if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $luxuryInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Luxuskabine wird konstruiert...",
__CLASS__,
__LINE__
));
$premierInstance = new PremierCabin();
// Debug message
- if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $premierInstance->getDebugInstance()->output("[PremierCabin:] Eine Premier-Kabine wird konstruiert...<br />\n");
+ if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $premierInstance->getDebugInstance()->output("[PremierCabin:] Eine Premier-Kabine wird konstruiert...");
// Abmasse extrahieren
$premierInstance->extractDimensions($dim);
// Kabine hinzufuegen
public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $cabinInstance) {
- if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Kabine <strong>%s</strong> wird für das Schiff <strong>%s</strong> konstruiert.<br />\n",
+ if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Kabine <strong>%s</strong> wird für das Schiff <strong>%s</strong> konstruiert.",
__CLASS__,
__LINE__,
$cabinInstance->getObjectDescription(),
$this->setDeckInstance($cabinInstance);
// Einbaut-Meldung ausgeben
- if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Kabine <strong>%s</strong> wurde in das Schiff eingebaut.<br />\n",
+ if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Kabine <strong>%s</strong> wurde in das Schiff eingebaut.",
__CLASS__,
__LINE__,
$cabinInstance->getObjectDescription(),
// 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.<br />\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] <strong>%d</strong> Betten angefordert.<br />\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] <strong>%d</strong> Kabine(n) angefordert.<br />\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] <strong>%d</strong> Betten gesetzt.<br />\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] <strong>%d</strong> Raum/Räume gesetzt.<br />\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] <strong>%d</strong> Kabine(n) gesetzt.<br />\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.<br />\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.<br />\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.<br />\n",
- __CLASS__,
- __LINE__
- ));
unset($this->numRooms);
}
}
// Debug-Meldung ausgeben
- $this->getDebugInstance()->output(sprintf("[%s:%d] Es exisitieren <strong>%d</strong> Kabinen vom Typ <strong>%s</strong> zu je <strong>%d</strong> Betten. Das sind <strong>%d</strong> Betten.<br />\n",
+ $this->getDebugInstance()->output(sprintf("[%s:%d] Es exisitieren <strong>%d</strong> Kabinen vom Typ <strong>%s</strong> zu je <strong>%d</strong> Betten. Das sind <strong>%d</strong> Betten.",
__CLASS__,
__LINE__,
$num,
// 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 <strong>%s</strong> wird für das Schiff <strong>%s</strong> konstruiert.<br />\n",
+ if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Deck <strong>%s</strong> wird für das Schiff <strong>%s</strong> konstruiert.",
__CLASS__,
__LINE__,
$deckInstance->getObjectDescription(),
$this->setNumDecks($deckInstance->getNumDecks());
$deckInstance->removeNumDecks();
- if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Deck <strong>%s</strong> wurde in das Schiff <strong>%s</strong> eingebaut.<br />\n",
+ if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Deck <strong>%s</strong> wurde in das Schiff <strong>%s</strong> eingebaut.",
__CLASS__,
__LINE__,
$deckInstance->getObjectDescription(),
// Deckanzahl entfernen
public final function removeNumDecks() {
- if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Decks wurde gelöscht.<br />\n",
- __CLASS__,
- __LINE__
- ));
unset($this->numDecks);
}
$carInstance = new CarDeck();
// Debug message
- if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $carInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Autodeck wird konstruiert...<br />\n",
+ if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $carInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein Autodeck wird konstruiert...",
__CLASS__,
__LINE__
));
$trainInstance = new TrainDeck();
// Debug message
- if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $trainInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein LKW-Deck wird konstruiert...<br />\n",
+ if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $trainInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein LKW-Deck wird konstruiert...",
__CLASS__,
__LINE__
));
$truckInstance = new TruckDeck();
// Debug message
- if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $truckInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein LKW-Deck wird konstruiert...<br />\n",
+ if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $truckInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein LKW-Deck wird konstruiert...",
__CLASS__,
__LINE__
));
$bridgeInstance = new Bridge();
// Debug message
- if ((defined('DEBUG_MODE')) || (defined('DEBUG_ALL'))) $bridgeInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Brücke wird konstruiert...<br />\n",
+ if ((defined('DEBUG_MODE')) || (defined('DEBUG_ALL'))) $bridgeInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Brücke wird konstruiert...",
__CLASS__,
__LINE__
));
*/
public function __construct (array $classArray, $code) {
// Add a message around the missing class
- $message = sprintf("[%s:%d] Registry key <span id=\"exception_reason\">%s</span> does not include a class with implemented interface <u>ManageableUser</u>.",
+ $message = sprintf("[%s:%d] Registry key <span id=\"exception_reason\">%s</span> does not include a class with implemented interface <u>Manageable(User|Guest)</u>.",
$classArray[0]->__toString(),
$this->getLine(),
$classArray[1]
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An interface for deliverable mail aka. mailer classes
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+interface DeliverableMail extends FrameworkInterface {
+}
+
+//
+?>
--- /dev/null
+<?php
+/**
+ * An interface for manageable accounts (logged-in users and guests likewise)
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+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);
+}
+
+//
+?>
+++ /dev/null
-<?php
-/**
- * An interface for manageable users
- *
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @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 <http://www.gnu.org/licenses/>.
- */
-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);
-}
-
-//
-?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An interface for manageable guests
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+interface ManageableGuest extends ManageableAccount {
+}
+
+//
+?>
--- /dev/null
+<?php
+/**
+ * An interface for manageable users
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+interface ManageableUser extends ManageableAccount {
+}
+
+//
+?>
if ($this->__toString() != "DestructedObject") {
// Debug message
if ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) {
- $this->getDebugInstance()->output(sprintf("[%s:] Das Objekt <strong>%s</strong> wird zerstört.<br />\n",
+ $this->getDebugInstance()->output(sprintf("[%s:] Das Objekt <strong>%s</strong> wird zerstört.",
__CLASS__, $this->__toString()
));
} // END - if
$this->resetUniqueID();
} elseif ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) {
// Already destructed object
- $this->getDebugInstance()->output(sprintf("[%s:] Das Objekt <strong>%s</strong> wurde bereits zerstört.<br />\n",
+ $this->getDebugInstance()->output(sprintf("[%s:] Das Objekt <strong>%s</strong> wurde bereits zerstört.",
__CLASS__, $this->__toString()
));
}
/**
* 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
/**
* 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) {
/**
* 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
/**
* 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) {
/**
* 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
/**
* 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) {
/**
* 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
/**
* 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) {
/**
* 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
/**
* 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) {
/**
* 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
/**
* 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) {
/**
* 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
/**
* 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) {
/**
* 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
/**
* 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) {
/**
* 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
/**
* 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();
}
/**
// Read the file
$hostname = trim($io->readFromFile());
- $helper->getDebugInstance()->output(sprintf("[%s:] Our host name is: <strong>%s</strong><br />\n",
+ $helper->getDebugInstance()->output(sprintf("[%s:] Our host name is: <strong>%s</strong>",
$helper->__toString(),
$hostname
));
$ip = $ipResolved;
// Debug message
- $helper->getDebugInstance()->output(sprintf("[%s:] Resolved IP address is: <strong>%s</strong><br />\n",
+ $helper->getDebugInstance()->output(sprintf("[%s:] Resolved IP address is: <strong>%s</strong>\n",
$helper->__toString(),
$ip
));
* @return void
*/
public final function outputStream ($output) {
- print($output);
+ // Strip out <br />
+ $output = str_replace("<br />", "", $output);
+ print($output."<br />\n");
}
/**
// Stop processing here
exit();
} // END - if
+
+ // Add this instance to registry
+ Registry::getRegistry()->addInstance('user', $userInstance);
}
}
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ *
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+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]
+?>
--- /dev/null
+<?php
+/**
+ * A general mailer class for all other mailers
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+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]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ *
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+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]
+?>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class Guest extends BaseFrameworkSystem implements ManageableUser, Registerable {
+class Guest extends BaseFrameworkSystem implements ManageableGuest, Registerable {
/**
* Instance of the database result
*/
// 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
// 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);
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: <strong>%s</strong><br />\n",
+ ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong>",
$e->getMessage()
));
} catch (SavePathNotFoundException $e) {
- ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong><br />\n",
+ ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong>",
$e->getMessage()
));
} catch (SavePathIsNoDirectoryException $e) {
- ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong><br />\n",
+ ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong>",
$e->getMessage()
));
} catch (SavePathReadProtectedException $e) {
- ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong><br />\n",
+ ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong>",
$e->getMessage()
));
} catch (SavePathWriteProtectedException $e) {
- ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong><br />\n",
+ ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong>",
$e->getMessage()
));
}
/**
* A test case for the configuration sub system
*
- * @author Roland Haeder <webmaster@mxchange.org>
+ * @author Roland Haeder <webmaster@ship-simu.org>
* @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
/**
* A test case for the registry
*
- * @author Roland Haeder <webmaster@mxchange.org>
+ * @author Roland Haeder <webmaster@ship-simu.org>
* @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
$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);
$userInstance = $registryInstance->getInstance('user');
// Compare both unique keys
- $testPassed = ($userInstance instanceof ManageableUser);
+ $testPassed = ($userInstance instanceof ManageableAccount);
// Test passed?
if (!$testPassed) {
* 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 <webmaster@mxchange.org>
+ * @author Roland Haeder <webmaster@ship-simu.org>
* @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
));
}
}
+
+ /**
+ * 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)
+ ));
+ }
+ }
}
?>
/**
* A test case for
*
- * @author Roland Haeder <webmaster@mxchange.org>
+ * @author Roland Haeder <webmaster@ship-simu.org>
* @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