X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fselector%2Fclass_ApplicationSelector.php;h=f6dab265c8f6fd415ab150556ef4d23c9a858edf;hb=55b327a3f5f2fe1d244532e07be7444e94b2a768;hp=a7f3294d1f8458615fea5befad9c3cc703cf1ed7;hpb=1d128d8532290e84885d09d2d3f0060abd08e49e;p=shipsimu.git diff --git a/application/selector/class_ApplicationSelector.php b/application/selector/class_ApplicationSelector.php index a7f3294..f6dab26 100644 --- a/application/selector/class_ApplicationSelector.php +++ b/application/selector/class_ApplicationSelector.php @@ -9,7 +9,7 @@ * @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 * * 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 @@ -46,11 +46,12 @@ class ApplicationSelector extends BaseFrameworkSystem { private $dirIgnoreList = array( ".", "..", - ".htaccess" + ".htaccess", + ".svn" ); /** - * The private constructor. No direct instances can be created from this. + * The protected constructor. No direct instances can be created from this. * * @return void */ @@ -62,7 +63,7 @@ class ApplicationSelector extends BaseFrameworkSystem { $this->setObjectDescription("Applikationswechsler"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Remove system array and thousand seperator $this->removeSystemArray(); @@ -80,7 +81,7 @@ class ApplicationSelector extends BaseFrameworkSystem { * @param $fileIOInstance The file I/O instance * @return $selInstance An instance of ApplicationSelector */ - public final static function createApplicationSelector (ManageableLanguage $langInstance, FileIOHandler $fileIOInstance) { + public final static function createApplicationSelector (ManageableLanguage $langInstance, FileIoHandler $fileIOInstance) { // Get a new instance $selInstance = new ApplicationSelector(); @@ -89,7 +90,7 @@ class ApplicationSelector extends BaseFrameworkSystem { // Set language and file I/O instances $selInstance->setLanguageInstance($langInstance); - $selInstance->setFileIOInstance($fileIOInstance); + $selInstance->setFileIoInstance($fileIOInstance); // Return the prepared instance return $selInstance; @@ -101,7 +102,7 @@ class ApplicationSelector extends BaseFrameworkSystem { * @return void */ private function initializeAppsList () { - $this->foundApps = new FrameworkArrayObject(); + $this->foundApps = new FrameworkArrayObject("FakedFoundApplications"); } /** @@ -110,7 +111,7 @@ class ApplicationSelector extends BaseFrameworkSystem { * @return void */ private function initializeTemplatesList () { - $this->loadedTemplates = new FrameworkArrayObject(); + $this->loadedTemplates = new FrameworkArrayObject("FakedLoadedTemplates"); } /** @@ -141,9 +142,9 @@ class ApplicationSelector extends BaseFrameworkSystem { } elseif (!is_object($app)) { // Not an object throw new NoObjectException($app, self::EXCEPTION_IS_NO_OBJECT); - } elseif (!method_exists($app, $this->getConfigInstance()->readConfig("entry_method"))) { + } elseif (!method_exists($app, $this->getConfigInstance()->readConfig('entry_method'))) { // Method not found! - throw new MissingMethodException(array($app, $this->getConfigInstance()->readConfig("entry_method")), self::EXCEPTION_MISSING_METHOD); + throw new MissingMethodException(array($app, $this->getConfigInstance()->readConfig('entry_method')), self::EXCEPTION_MISSING_METHOD); } // Add the current instance to the list @@ -186,7 +187,7 @@ class ApplicationSelector extends BaseFrameworkSystem { * @return $shortName This selector's short name */ public function getAppShortName() { - $shortName = $this->getConfigInstance()->readConfig("selector_path"); + $shortName = $this->getConfigInstance()->readConfig('selector_path'); return $shortName; } @@ -212,11 +213,11 @@ class ApplicationSelector extends BaseFrameworkSystem { // Generate the base path for all applications $appBasePath = sprintf("%s%s/", PATH, - $this->getConfigInstance()->readConfig("application_path") + $this->getConfigInstance()->readConfig('application_path') ); // Add the selector path to the ignore list - $this->addDirIgnoreList($this->getConfigInstance()->readConfig("selector_path")); + $this->addDirIgnoreList($this->getConfigInstance()->readConfig('selector_path')); // Get a directory pointer for the application path $dirInstance = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($appBasePath); @@ -233,7 +234,7 @@ class ApplicationSelector extends BaseFrameworkSystem { // Is this a readable directory? (files will be ignored silently) if ((is_dir($fqfn)) && (is_readable($fqfn))) { // Then get the init.php script for analyzing - $initScript = sprintf("%s/init%s", $fqfn, $this->getConfigInstance()->readConfig("php_extension")); + $initScript = sprintf("%s/init%s", $fqfn, $this->getConfigInstance()->readConfig('php_extension')); // Load the application's init.php script and append the // application to the ArrayObject @@ -266,7 +267,7 @@ class ApplicationSelector extends BaseFrameworkSystem { // Try to load the web template $tplEngine->loadWebTemplate(sprintf("%s_%s", - $this->getConfigInstance()->readConfig("tpl_selector_prefix"), + $this->getConfigInstance()->readConfig('tpl_selector_prefix'), strtolower($appInstance->getAppShortName()) )); @@ -301,7 +302,7 @@ class ApplicationSelector extends BaseFrameworkSystem { $tplEngine = $this->prepareTemplateEngine($this); // Load the selector's template - $tplEngine->loadCodeTemplate($this->getConfigInstance()->readConfig("selector_main_tpl")); + $tplEngine->loadCodeTemplate($this->getConfigInstance()->readConfig('selector_main_tpl')); // Now store it in the class $this->setSelectorTemplateEngine($tplEngine); @@ -323,7 +324,7 @@ class ApplicationSelector extends BaseFrameworkSystem { $tplEngine = $this->prepareTemplateEngine($this); // Load template which shall later hold all application templates - $tplEngine->loadCodeTemplate($this->getConfigInstance()->readConfig("selector_apps_tpl")); + $tplEngine->loadCodeTemplate($this->getConfigInstance()->readConfig('selector_apps_tpl')); // Add all loaded application templates together $dummy = ""; @@ -349,16 +350,6 @@ class ApplicationSelector extends BaseFrameworkSystem { } // END - for } - - /** - * Stub! - */ - public function saveObjectToDatabase () { - $this->getDebugInstance()->output(sprintf("[%s:] Stub %s erreicht.", - $this->__toString(), - __FUNCTION__ - )); - } } // [EOF]