From: Roland Häder Date: Mon, 7 Apr 2008 12:26:44 +0000 (+0000) Subject: final added, code clean-ups X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d5be335b3a658deb8340ac50d8b7d7e638c59062;p=shipsimu.git final added, code clean-ups --- diff --git a/application/selector/class_ApplicationSelector.php b/application/selector/class_ApplicationSelector.php index eb863ba..b29414a 100644 --- a/application/selector/class_ApplicationSelector.php +++ b/application/selector/class_ApplicationSelector.php @@ -286,7 +286,7 @@ class ApplicationSelector extends BaseFrameworkSystem { * * @return void */ - public function removeDirIgnoreList () { + public final function removeDirIgnoreList () { unset($this->dirIgnoreList); } diff --git a/application/ship-simu/main/class_BaseSimulator.php b/application/ship-simu/main/class_BaseSimulator.php index 47576da..ec3fe30 100644 --- a/application/ship-simu/main/class_BaseSimulator.php +++ b/application/ship-simu/main/class_BaseSimulator.php @@ -146,7 +146,7 @@ class BaseSimulator extends BaseFrameworkSystem { } // Remover-Methode fuer die Teil-Instanz - public function removePartInstance () { + 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", @@ -177,7 +177,7 @@ class BaseSimulator extends BaseFrameworkSystem { if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Maschinenraum mit Motor %s wird fuer das Schiff %s konstruiert.
\n", $this->__toString(), - $this->currPart->getPartDescr(), + $this->getCurrPart()->getPartDescr(), $this->currShip->getShipName() )); @@ -186,17 +186,17 @@ class BaseSimulator extends BaseFrameworkSystem { // 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", $this->__toString(), - $this->currPart->getPartDescr(), - $this->currPart->__toString(), + $this->getCurrPart()->getPartDescr(), + $this->getCurrPart()->__toString(), $this->currShip->getShipName() )); // Muessen die Masse angepasst werden? if ($this->isResizeFactorValid()) { // Neue Angaben berechnen (wir lassen etwas Lust fuer Kabelbaeume, Roehren, Maschinisten, etc.) - $this->newWidth = (float) $this->currPart->getWidth() * $this->resizeFactorArray['width']; - $this->newHeight = (float) $this->currPart->getHeight() * $this->resizeFactorArray['height']; - $this->newLength = (float) $this->currPart->getLength() * $this->resizeFactorArray['length']; + $this->newWidth = (float) $this->getCurrPart()->getWidth() * $this->resizeFactorArray['width']; + $this->newHeight = (float) $this->getCurrPart()->getHeight() * $this->resizeFactorArray['height']; + $this->newLength = (float) $this->getCurrPart()->getLength() * $this->resizeFactorArray['length']; // Passt dies nun immer noch? if ($this->isNewSizeValid()) { @@ -215,41 +215,41 @@ class BaseSimulator extends BaseFrameworkSystem { } else { // Passt nicht! Also wieder Exception werfen... throw new StructureShipMismatchException(sprintf("[%s:] Das Schiffsteil %s vom Typ %s ist zu gross für das Schiff!", - $this->currPart->__toString(), - $this->currPart->getPartDescr(), - $this->currPart->__toString() + $this->getCurrPart()->__toString(), + $this->getCurrPart()->getPartDescr(), + $this->getCurrPart()->__toString() ), 2); } } elseif ($this->currPart != null) { // Aktuelle Masse setzen - $this->setWidth($this->currPart->getWidth()); - $this->setHeight($this->currPart->getHeight()); - $this->setLength($this->currPart->getLength()); + $this->setWidth($this->getCurrPart()->getWidth()); + $this->setHeight($this->getCurrPart()->getHeight()); + $this->setLength($this->getCurrPart()->getLength()); } // Existiert ein Schiffsteil? if (!is_null($this->currPart)) { // Debug-Meldung ausgeben if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Schiffsteil %s gefunden.
\n", - $this->currPart->realClass, - $this->currPart->getPartDescr() + $this->getCurrPart()->realClass, + $this->getCurrPart()->getPartDescr() )); // Schiffsteil-Instanz setzen $this->setPartInstance($this->currPart); // Instanzen entfernen - $this->currPart->removeCurrShip(); - $this->currPart->removeCurrPart(); - $this->currPart->removePartInstance(); - $this->currPart->removeResizeFactorArray(); + $this->getCurrPart()->removeCurrShip(); + $this->getCurrPart()->removeCurrPart(); + $this->getCurrPart()->removePartInstance(); + $this->getCurrPart()->removeResizeFactorArray(); } } else { // Exception werfen! throw new StructureShipMismatchException(sprintf("[%s:] Das Schiffsteil %s vom Typ %s passt nicht in das Schiff!", - $this->currPart->realClass, - $this->currPart->getPartDescr(), - $this->currPart->__toString() + $this->getCurrPart()->realClass, + $this->getCurrPart()->getPartDescr(), + $this->getCurrPart()->__toString() ), 1); } @@ -260,7 +260,7 @@ class BaseSimulator extends BaseFrameworkSystem { } // Array fuer Umrechnungstabelle entfernen - public function removeResizeFactorArray () { + public final function removeResizeFactorArray () { if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] removeResizeFactor erreicht.
\n", $this->__toString() )); @@ -272,7 +272,7 @@ class BaseSimulator extends BaseFrameworkSystem { * * @return void */ - public function removeAllNewAttr () { + public final function removeAllNewAttr () { unset($this->newWidth); unset($this->newHeight); unset($this->newLength); @@ -283,7 +283,7 @@ class BaseSimulator extends BaseFrameworkSystem { * * @return void */ - public function removeCurrShip () { + public final function removeCurrShip () { if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] removeCurrShip erreicht.
\n", $this->__toString() )); @@ -291,7 +291,7 @@ class BaseSimulator extends BaseFrameworkSystem { } // Aktuelle Schiffsteil-Instanz entfernen - public function removeCurrPart () { + public final function removeCurrPart () { if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] removeCurrPart erreicht.
\n", $this->__toString() )); @@ -299,7 +299,7 @@ class BaseSimulator extends BaseFrameworkSystem { } // Breite entfernen - public function removeWidth () { + public final function removeWidth () { if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Breite entfernt.
\n", $this->__toString() )); @@ -307,7 +307,7 @@ class BaseSimulator extends BaseFrameworkSystem { } // Hoehe entfernen - public function removeHeight () { + public final function removeHeight () { if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Höhe entfernt.
\n", $this->__toString() )); @@ -315,7 +315,7 @@ class BaseSimulator extends BaseFrameworkSystem { } // Laenge entfernen - public function removeLength () { + public final function removeLength () { if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Länge entfernt.
\n", $this->__toString() )); @@ -323,7 +323,7 @@ class BaseSimulator extends BaseFrameworkSystem { } // Tiefgang entfernen - public function removeDraught () { + public final function removeDraught () { if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Tiefgang entfernt.
\n", $this->__toString() )); @@ -363,18 +363,18 @@ class BaseSimulator extends BaseFrameworkSystem { return ( ( ( // Already defined ship messurings - ($this->currPart->getWidth() < $this->currShip->getWidth()) - && ($this->currPart->getHeight() < $this->currShip->getDraught()) - && ($this->currPart->getLength() < $this->currShip->getLength()) + ($this->getCurrPart()->getWidth() < $this->currShip->getWidth()) + && ($this->getCurrPart()->getHeight() < $this->currShip->getDraught()) + && ($this->getCurrPart()->getLength() < $this->currShip->getLength()) ) || ( // Ship messurings shall be calculated ($this->currShip->getWidth() == 0) && ($this->currShip->getHeight() == 0) && ($this->currShip->getLength() == 0) ) // The inserted part must be messured! - ) && ($this->currPart->getWidth() > 0) - && ($this->currPart->getHeight() > 0) - && ($this->currPart->getLength() > 0) + ) && ($this->getCurrPart()->getWidth() > 0) + && ($this->getCurrPart()->getHeight() > 0) + && ($this->getCurrPart()->getLength() > 0) ); } @@ -414,6 +414,15 @@ class BaseSimulator extends BaseFrameworkSystem { throw new DimNotFoundInArrayException($this, self::EXCEPTION_DIMENSION_ARRAY_INVALID); } } + + /** + * Getter for current part instance + * + * @return $currPart Instance of the current ship part object + */ + public final function getCurrPart () { + return $this->currPart; + } } // [EOF] diff --git a/application/ship-simu/main/constructions/class_BaseConstruction.php b/application/ship-simu/main/constructions/class_BaseConstruction.php index 2874302..dd36ae6 100644 --- a/application/ship-simu/main/constructions/class_BaseConstruction.php +++ b/application/ship-simu/main/constructions/class_BaseConstruction.php @@ -53,7 +53,7 @@ class BaseConstruction extends BaseSimulator { } // Tiefgang entfernen - public function removeDraught () { + public final function removeDraught () { if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Tiefgang wird entfernt.
\n", $this->__toString() )); diff --git a/application/ship-simu/main/drives/class_BaseDrive.php b/application/ship-simu/main/drives/class_BaseDrive.php index ce8d9e4..a8ed338 100644 --- a/application/ship-simu/main/drives/class_BaseDrive.php +++ b/application/ship-simu/main/drives/class_BaseDrive.php @@ -90,7 +90,7 @@ class BaseDrive extends BaseSimulator { return $this->price; } - public function removePrice () { + public final function removePrice () { unset($this->price); } } diff --git a/application/ship-simu/main/parts/class_BaseShipPart.php b/application/ship-simu/main/parts/class_BaseShipPart.php index f209652..9bb8b6e 100644 --- a/application/ship-simu/main/parts/class_BaseShipPart.php +++ b/application/ship-simu/main/parts/class_BaseShipPart.php @@ -66,7 +66,7 @@ class BaseShipPart extends BaseSimulator { } // Remove price - public function removePrice () { + public final function removePrice () { unset($this->price); } } diff --git a/application/ship-simu/main/structures/class_BaseStructure.php b/application/ship-simu/main/structures/class_BaseStructure.php index 733f0c4..5259ca2 100644 --- a/application/ship-simu/main/structures/class_BaseStructure.php +++ b/application/ship-simu/main/structures/class_BaseStructure.php @@ -66,7 +66,7 @@ class BaseStructure extends BaseSimulator { } // Remove price - public function removePrice () { + public final function removePrice () { unset($this->price); } } 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 d95cc97..7b41210 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 @@ -71,36 +71,6 @@ class EconomyCabin extends BaseCabin implements TradeableItem, ConstructableShip return $ecoInstance; } - // Loesch-Methode fuer Anzahl Betten - public function removeNumBeds() { - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Betten gelöscht.
\n", - __CLASS__, - __LINE__ - )); - unset($this->numBeds); - parent::removeNumBeds(); - } - - // Loesch-Methode fuer Anzahl Kabinen - public function removeNumCabin() { - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Kabinen gelöscht.
\n", - __CLASS__, - __LINE__ - )); - unset($this->numCabin); - parent::removeNumCabin(); - } - - // Loesch-Methode fuer Anzahl Raeume - public function removeNumRooms() { - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Räume gelöscht.
\n", - __CLASS__, - __LINE__ - )); - unset($this->numRooms); - parent::removeNumRooms(); - } - // Overwritten method for tradeable items public function isTradeable () { return true; 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 7767ea3..ad0bc84 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 @@ -69,36 +69,6 @@ class LowCabin extends BaseCabin implements TradeableItem, ConstructableShipPart return $lowInstance; } - // Loesch-Methode fuer Anzahl Betten - public function removeNumBeds() { - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Betten gelöscht.
\n", - __CLASS__, - __LINE__ - )); - unset($this->numBeds); - parent::removeNumBeds(); - } - - // Loesch-Methode fuer Anzahl Kabinen - public function removeNumCabin() { - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Kabinen gelöscht.
\n", - __CLASS__, - __LINE__ - )); - unset($this->numCabin); - parent::removeNumCabin(); - } - - // Loesch-Methode fuer Anzahl Raeume - public function removeNumRooms() { - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Räume gelöscht.
\n", - __CLASS__, - __LINE__ - )); - unset($this->numRooms); - parent::removeNumRooms(); - } - // Overwritten method for tradeable items public function isTradeable () { return true; 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 6b1e580..95333fb 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 @@ -69,36 +69,6 @@ class LuxuryCabin extends BaseCabin implements TradeableItem, ConstructableShipP return $luxuryInstance; } - // Loesch-Methode fuer Anzahl Betten - public function removeNumBeds() { - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Betten gelöscht.
\n", - __CLASS__, - __LINE__ - )); - unset($this->numBeds); - parent::removeNumBeds(); - } - - // Loesch-Methode fuer Anzahl Kabinen - public function removeNumCabin() { - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Kabinen gelöscht.
\n", - __CLASS__, - __LINE__ - )); - unset($this->numCabin); - parent::removeNumCabin(); - } - - // Loesch-Methode fuer Anzahl Raeume - public function removeNumRooms() { - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Räume gelöscht.
\n", - __CLASS__, - __LINE__ - )); - unset($this->numRooms); - parent::removeNumRooms(); - } - // Overwritten method for tradeable items public function isTradeable () { return true; 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 3daabda..b4e5b74 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 @@ -66,36 +66,6 @@ class PremierCabin extends BaseCabin implements TradeableItem, ConstructableShip return $premierInstance; } - // Loesch-Methode fuer Anzahl Betten - public function removeNumBeds() { - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Betten gelöscht.
\n", - __CLASS__, - __LINE__ - )); - unset($this->numBeds); - parent::removeNumBeds(); - } - - // Loesch-Methode fuer Anzahl Kabinen - public function removeNumCabin() { - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Kabinen gelöscht.
\n", - __CLASS__, - __LINE__ - )); - unset($this->numCabin); - parent::removeNumCabin(); - } - - // Loesch-Methode fuer Anzahl Raeume - public function removeNumRooms() { - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Räume gelöscht.
\n", - __CLASS__, - __LINE__ - )); - unset($this->numRooms); - parent::removeNumRooms(); - } - // Overwritten method for tradeable items public function isTradeable () { return true; diff --git a/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php b/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php index e989b25..cf50ce1 100644 --- a/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php +++ b/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php @@ -153,7 +153,7 @@ class BaseCabinStructure extends BaseStructure { } // Loesch-Methode fuer Anzahl Betten - public function removeNumBeds() { + public final function removeNumBeds() { if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Betten gelöscht.
\n", __CLASS__, __LINE__ @@ -162,7 +162,7 @@ class BaseCabinStructure extends BaseStructure { } // Loesch-Methode fuer Anzahl Kabinen - public function removeNumCabin() { + public final function removeNumCabin() { if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Kabinen gelöscht.
\n", __CLASS__, __LINE__ @@ -171,7 +171,7 @@ class BaseCabinStructure extends BaseStructure { } // Loesch-Methode fuer Anzahl Raeume - public function removeNumRooms() { + 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__ diff --git a/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php b/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php index 2ba52a5..e947673 100644 --- a/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php +++ b/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php @@ -77,7 +77,7 @@ class BaseDeckStructure extends BaseStructure { } // Deckanzahl entfernen - public function removeNumDecks() { + 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__ 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 61aaee0..ca4a9dd 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 @@ -67,15 +67,6 @@ class CarDeck extends BaseDeck implements TradeableItem, ConstructableShipPart { return $carInstance; } - // Deckanzahl entfernen - public function removeNumDecks() { - if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Decks wurde gelöscht.
\n", - __CLASS__, - __LINE__ - )); - parent::removeNumDecks(); - } - // Overwritten method for tradeable items public function isTradeable () { return true; 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 06f132a..2c9bcbe 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 @@ -67,15 +67,6 @@ class TrainDeck extends BaseDeck implements TradeableItem, ConstructableShipPart return $trainInstance; } - // Deckanzahl entfernen - public function removeNumDecks() { - if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Decks wurde gelöscht.
\n", - __CLASS__, - __LINE__ - )); - parent::removeNumDecks(); - } - // Overwritten method for tradeable items public function isTradeable () { return true; 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 ccbe596..4f29d60 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 @@ -68,15 +68,6 @@ class TruckDeck extends BaseDeck implements TradeableItem, ConstructableShipPart return $truckInstance; } - // Deckanzahl entfernen - public function removeNumDecks() { - if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Decks wurde gelöscht.
\n", - __CLASS__, - __LINE__ - )); - parent::removeNumDecks(); - } - // Overwritten method for tradeable items public function isTradeable () { return true; diff --git a/inc/classes/main/template/class_TemplateEngine.php b/inc/classes/main/template/class_TemplateEngine.php index cc95918..1dfb7ad 100644 --- a/inc/classes/main/template/class_TemplateEngine.php +++ b/inc/classes/main/template/class_TemplateEngine.php @@ -136,16 +136,16 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate /** * Creates an instance of the class TemplateEngine and prepares it for usage * - * @param $basePath The local base path for all templates - * @param $langInstance An instance of LanguageSystem (default) - * @param $ioInstance An instance of FileIOHandler (default, middleware!) + * @param $basePath The local base path for all templates + * @param $langInstance An instance of LanguageSystem (default) + * @param $ioInstance An instance of FileIOHandler (default, middleware!) * @return $tplInstance An instance of TemplateEngine * @throws BasePathIsEmptyException If the provided $basePath is empty * @throws InvalidBasePathStringException If $basePath is no string * @throws BasePathIsNoDirectoryException If $basePath is no - * directory or not found + * directory or not found * @throws BasePathReadProtectedException If $basePath is - * read-protected + * read-protected */ public final static function createTemplateEngine ($basePath, ManageableLanguage $langInstance, FileIOHandler $ioInstance) { // Get a new instance @@ -580,11 +580,11 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate /** * Extract variables from a given raw data stream * - * @param $rawData The raw template data we shall analyze + * @param $rawData The raw template data we shall analyze * @return void * @throws InvalidTemplateVariableNameException If a variable name - * in a template is - * invalid + * in a template is + * invalid */ private function extractVariablesFromRawData ($rawData) { // Cast to string @@ -776,6 +776,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate $this->assignVariable($var, $varMatches[3][$key]); } else { // Non-string found so we need some deeper analysis... + // @TODO Unfinished work or don't die here. die("Deeper analysis not yet implemented!"); } diff --git a/inc/loader/class_ClassLoader.php b/inc/loader/class_ClassLoader.php index 61e8c21..79389f6 100644 --- a/inc/loader/class_ClassLoader.php +++ b/inc/loader/class_ClassLoader.php @@ -274,15 +274,17 @@ class ClassLoader { // Set new prefix (temporary!) $this->prefix = "config-"; + $this->preLen = strlen($this->prefix); // Set base directory - $basePath = sprintf("%s/inc/config/", PATH); + $basePath = sprintf("%sinc/config/", PATH); // Load all classes from the config directory $this->loadClasses($basePath); // Set the prefix back $this->prefix = $oldPrefix; + $this->preLen = strlen($this->prefix); } }