]> git.mxchange.org Git - shipsimu.git/commitdiff
readConfig() is not naming convention, renamed to getConfigEntry()
authorRoland Häder <roland@mxchange.org>
Tue, 28 Jul 2009 17:27:18 +0000 (17:27 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 28 Jul 2009 17:27:18 +0000 (17:27 +0000)
23 files changed:
application/selector/class_ApplicationHelper.php
application/selector/class_ApplicationSelector.php
application/selector/data.php
application/selector/init.php
application/selector/loader.php
application/selector/starter.php
application/ship-simu/class_ApplicationHelper.php
application/ship-simu/data.php
application/ship-simu/init.php
application/ship-simu/loader.php
application/ship-simu/main/commands/web/class_WebShipsimuRefillCommand.php
application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php
application/ship-simu/main/filter/page/class_RefillPageFilter.php
application/ship-simu/main/government/class_SimplifiedGovernment.php
application/ship-simu/main/login/class_ShipSimuGuestLogin.php
application/ship-simu/main/login/class_ShipSimuUserLogin.php
application/ship-simu/main/login/helper/class_ShipSimuLoginHelper.php
application/ship-simu/main/registration/class_ShipSimuRegistration.php
application/ship-simu/main/resolver/web/class_WebGovernmentFailedCommandResolver.php
application/ship-simu/main/user/class_ShipSimuBaseUser.php
application/ship-simu/main/user/extended/class_ShipSimuMember.php
application/ship-simu/starter.php
index.php

index 1d4f9e710e6f7026aa9c519f17bbea257107b3ec..b089944e4d7bf641219a12cf54c64800313fa246 100644 (file)
@@ -199,7 +199,11 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
 
                // If it is null then get default command
                if (is_null($commandName)) {
+                       // Get default command
                        $commandName = $responseInstance->getDefaultCommand();
+
+                       // Set it in request
+                       $requestInstance->setRequestElement('page');
                } // END - if
 
                // Get a resolver
index b0aca0648fb1bc1129a4c0f7eb6ff70f598ff957..ee637f7d1a68705cca9aa2cf7e6642b6007c5e20 100644 (file)
@@ -135,7 +135,7 @@ class ApplicationSelector extends BaseFrameworkSystem {
         * @return      $shortName      This selector's short name
         */
        public function getAppShortName() {
-               $shortName = $this->getConfigInstance()->readConfig('selector_path');
+               $shortName = $this->getConfigInstance()->getConfigEntry('selector_path');
                return $shortName;
        }
 
@@ -158,10 +158,10 @@ class ApplicationSelector extends BaseFrameworkSystem {
         */
        public function readApplicationDirectory () {
                // Generate the base path for all applications
-               $appBasePath = $this->getConfigInstance()->readConfig('application_path');
+               $appBasePath = $this->getConfigInstance()->getConfigEntry('application_path');
 
                // Add the selector path to the ignore list
-               $this->addDirIgnoreList($this->getConfigInstance()->readConfig('selector_path'));
+               $this->addDirIgnoreList($this->getConfigInstance()->getConfigEntry('selector_path'));
 
                // Get a directory pointer for the application path
                $dirInstance = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($appBasePath);
@@ -202,7 +202,7 @@ class ApplicationSelector extends BaseFrameworkSystem {
 
                        // Try to load the web template
                        $templateInstance->loadWebTemplate(sprintf("%s_%s",
-                               $this->getConfigInstance()->readConfig('tpl_selector_prefix'),
+                               $this->getConfigInstance()->getConfigEntry('tpl_selector_prefix'),
                                strtolower($appInstance->getAppShortName())
                        ));
 
@@ -237,7 +237,7 @@ class ApplicationSelector extends BaseFrameworkSystem {
                $templateInstance = $this->prepareTemplateInstance($this);
 
                // Load the selector's template
-               $templateInstance->loadCodeTemplate($this->getConfigInstance()->readConfig('selector_main_tpl'));
+               $templateInstance->loadCodeTemplate($this->getConfigInstance()->getConfigEntry('selector_main_tpl'));
 
                // Now store it in the class, we need this later on final compilation of available applications
                $this->setTemplateInstance($templateInstance);
@@ -259,7 +259,7 @@ class ApplicationSelector extends BaseFrameworkSystem {
                $templateInstance = $this->prepareTemplateInstance($this);
 
                // Load template which shall later hold all application templates
-               $templateInstance->loadCodeTemplate($this->getConfigInstance()->readConfig('selector_apps_tpl'));
+               $templateInstance->loadCodeTemplate($this->getConfigInstance()->getConfigEntry('selector_apps_tpl'));
 
                // Add all loaded application templates together
                $dummy = "";
index 45876a318946174e275c33473f21118fb71ba489..99b3159c417214d3006c160795b5b5682cdfe7e4 100644 (file)
@@ -30,14 +30,14 @@ $cfg = FrameworkConfiguration::getInstance();
 
 // Get an instance of the helper
 $app = call_user_func_array(
-       array($cfg->readConfig('app_helper_class'), 'getInstance'),
+       array($cfg->getConfigEntry('app_helper_class'), 'getInstance'),
        array()
 );
 
 // Set application name and version
 $app->setAppName("Applikationsausw&auml;hler");
 $app->setAppVersion("0.1a");
-$app->setAppShortName($cfg->readConfig('selector_name'));
+$app->setAppShortName($cfg->getConfigEntry('selector_name'));
 
 // [EOF]
 ?>
index 9582c572a844bb787acf190b518bbf1b3057c8c4..487753e13f95386dc61ec1374d5fb87dc162b43d 100644 (file)
 $cfg = FrameworkConfiguration::getInstance();
 
 // Initialize output system
-require($cfg->readConfig('base_path') . 'inc/output.php');
+require($cfg->getConfigEntry('base_path') . 'inc/output.php');
 
 // Initialize file i/o system
-require($cfg->readConfig('base_path') . 'inc/file_io.php');
+require($cfg->getConfigEntry('base_path') . 'inc/file_io.php');
 
 // Include the language sub-system
-require($cfg->readConfig('base_path') . 'inc/language.php');
+require($cfg->getConfigEntry('base_path') . 'inc/language.php');
 
 // [EOF]
 ?>
index dc29d7204ca3d3072deec1abc6e3663b601ae147..a6b49bbfe180f51b9669d82d0937080b0418e956 100644 (file)
@@ -25,7 +25,7 @@
 $cfg = FrameworkConfiguration::getInstance();
 
 // Load all classes
-ClassLoader::getInstance()->scanClassPath(sprintf("%s/%s/", $cfg->readConfig('application_path'), $cfg->readConfig('app_name')));
+ClassLoader::getInstance()->scanClassPath(sprintf("%s/%s/", $cfg->getConfigEntry('application_path'), $cfg->getConfigEntry('app_name')));
 
 // Clean up the global namespace
 unset($lowerClasses);
index e4ede0ee1abfb18f00c240d6a1c21610fd493517..9336b4a4224eb2f7e968c82e39ae1f3ec9dce327 100644 (file)
 
 // Is there an application helper instance? We need the method main() for
 // maining the application
-$app = call_user_func_array(array(FrameworkConfiguration::getInstance()->readConfig('app_helper_class'), 'getInstance'), array());
+$app = call_user_func_array(array(FrameworkConfiguration::getInstance()->getConfigEntry('app_helper_class'), 'getInstance'), array());
 
 // Some sanity checks
 if ((empty($app)) || (is_null($app))) {
        // Something went wrong!
        ApplicationEntryPoint::app_die(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because the helper class <span class=\"class_name\">%s</span> is not loaded.",
                $application,
-               FrameworkConfiguration::getInstance()->readConfig('app_helper_class')
+               FrameworkConfiguration::getInstance()->getConfigEntry('app_helper_class')
        ));
 } elseif (!is_object($app)) {
        // No object!
        ApplicationEntryPoint::app_die(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because &#39;app&#39; is not an object.",
                $application
        ));
-} elseif (!method_exists($app, FrameworkConfiguration::getInstance()->readConfig('entry_method'))) {
+} elseif (!method_exists($app, FrameworkConfiguration::getInstance()->getConfigEntry('entry_method'))) {
        // Method not found!
        ApplicationEntryPoint::app_die(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because the method <span class=\"method_name\">%s</span> is missing.",
                $application,
-               FrameworkConfiguration::getInstance()->readConfig('entry_method')
+               FrameworkConfiguration::getInstance()->getConfigEntry('entry_method')
        ));
 }
 
 // Call the entry point method
-call_user_func_array(array($app, FrameworkConfiguration::getInstance()->readConfig('entry_method')), array());
+call_user_func_array(array($app, FrameworkConfiguration::getInstance()->getConfigEntry('entry_method')), array());
 
 // [EOF]
 ?>
index b8f4349bf7cd9faeb31e0c5cf6b84da66ef19571..f459a64580f07b87f0511978696bd9f57a99856e 100644 (file)
@@ -201,7 +201,11 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
 
                // If it is null then get default command
                if (is_null($commandName)) {
+                       // Get the default command
                        $commandName = $responseInstance->getDefaultCommand();
+
+                       // Set it in request
+                       $requestInstance->setRequestElement('page');
                } // END - if
 
                // Get a resolver
index 893b124146678cebcd0c5f65083fe95cac1287d7..c4249c4dce8a32d493a1e790528717c3f75e9cae 100644 (file)
@@ -38,7 +38,7 @@ $cfg = FrameworkConfiguration::getInstance();
 
 // Get an instance of the helper
 $app = call_user_func_array(
-       array($cfg->readConfig('app_helper_class'), 'getInstance'),
+       array($cfg->getConfigEntry('app_helper_class'), 'getInstance'),
        array()
 );
 
index 264384c3831e2b64e9cf83601bf6cdd1e8332e3e..3b9c30a077a6085679936cbc94774eafedba5972 100644 (file)
 $cfg = FrameworkConfiguration::getInstance();
 
 // Initialize output system
-require($cfg->readConfig('base_path') . 'inc/output.php');
+require($cfg->getConfigEntry('base_path') . 'inc/output.php');
 
 // Initialize file i/o system
-require($cfg->readConfig('base_path') . 'inc/file_io.php');
+require($cfg->getConfigEntry('base_path') . 'inc/file_io.php');
 
 // Include the language sub-system
-require($cfg->readConfig('base_path') . 'inc/language.php');
+require($cfg->getConfigEntry('base_path') . 'inc/language.php');
 
 // This application needs a database connection then we have to simply include
 // the inc/database.php script
-require($cfg->readConfig('base_path') . 'inc/database.php');
+require($cfg->getConfigEntry('base_path') . 'inc/database.php');
 
 // [EOF]
 ?>
index 549d0b28952da43c38c9102db4a72fcffc402278..46790372d73b380be89a123e1d470c2b4b99fb56 100644 (file)
@@ -28,7 +28,7 @@ $cfg = FrameworkConfiguration::getInstance();
 // Load all classes for the application
 foreach ($lowerClasses as $className) {
        // Load the application classes
-       ClassLoader::getInstance()->scanClassPath(sprintf("%s/%s/%s", $cfg->readConfig('application_path'), $cfg->readConfig('app_name'), $className));
+       ClassLoader::getInstance()->scanClassPath(sprintf("%s/%s/%s", $cfg->getConfigEntry('application_path'), $cfg->getConfigEntry('app_name'), $className));
 } // END - if
 
 // Clean up the global namespace
index 9bf663fc28c7c34aba933555f011be5ca209bbd3..4c9d0e881182ccb7fee681c83c987bb2431c3c72 100644 (file)
@@ -104,7 +104,7 @@ class WebShipsimuRefillCommand extends BaseCommand implements Commandable {
                // Prepare a filter based on the requested type we shall refill
                $filterName = sprintf("refill_request_%s_%s_book_filter",
                        $requestInstance->getRequestElement('type'),
-                       $this->getConfigInstance()->readConfig($paymentTypeConfig)
+                       $this->getConfigInstance()->getConfigEntry($paymentTypeConfig)
                );
 
                // Now, try to load that filter
index 1a0a99f28540de11f6ac0c106dc0aec054f0bc7f..831e1181265d41ac9ca3f88f9a5d8496b38613ac 100644 (file)
@@ -102,7 +102,7 @@ class WebShipsimuUserLoginCommand extends BaseCommand implements Commandable {
         */
        public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
                // Which login type do we have?
-               switch ($this->getConfigInstance()->readConfig('login_type')) {
+               switch ($this->getConfigInstance()->getConfigEntry('login_type')) {
                        case "username": // Login via username
                                $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter'));
                                break;
index 232fc3a585cf0df462dfd79c914d6865aab46908..202316a298647b3e28ce3cfd5f55688a3c081389 100644 (file)
@@ -58,7 +58,7 @@ class RefillPageFilter extends BaseShipSimuFilter implements Filterable {
                parent::execute($requestInstance, $responseInstance);
 
                // Is the configuration variable set?
-               if ($this->getConfigInstance()->readConfig('refill_page_active') === "N") {
+               if ($this->getConfigInstance()->getConfigEntry('refill_page_active') === "N") {
                        // Password is empty
                        $requestInstance->requestIsValid(false);
 
index 3cb6f8833ed61b5356326a919c283c10cdb5c91a..66416f7c75a70337ebed67fad35e3064c813e6f6 100644 (file)
@@ -100,7 +100,7 @@ class SimplifiedGovernment extends BaseFrameworkSystem implements Registerable {
                $maximumPayed = false;
 
                // Cache startup help limit
-               $helpLimit = $this->getConfigInstance()->readConfig('government_startup_help_limit');
+               $helpLimit = $this->getConfigInstance()->getConfigEntry('government_startup_help_limit');
 
                // Now get a search criteria and set the user's name as criteria
                $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
index ecdbadc4e0839ee5df235121eb9776240c5a7617..a026284d88abba64112ac18553915079f57d2dad 100644 (file)
@@ -85,13 +85,13 @@ class ShipSimuGuestLogin extends BaseFrameworkSystem implements LoginableUser {
                if (is_null($method)) {
                        // Then abort here
                        throw new UserAuthMethodException($this, self::EXCEPTION_MISSING_METHOD);
-               } elseif (!method_exists($this->getConfigInstance()->readConfig('guest_class'), $method)) {
+               } elseif (!method_exists($this->getConfigInstance()->getConfigEntry('guest_class'), $method)) {
                        // The method is invalid!
                        throw new MissingMethodException(array($this, $method), self::EXCEPTION_MISSING_METHOD);
                }
 
                // Get a user instance
-               $userInstance = call_user_func_array(array($this->getConfigInstance()->readConfig('guest_class'), $method), array($data));
+               $userInstance = call_user_func_array(array($this->getConfigInstance()->getConfigEntry('guest_class'), $method), array($data));
 
                // Remember this new instance in registry
                Registry::getRegistry()->addInstance('user', $userInstance);
index 270a8c690b7c1986a082a8b2d96ce44be9339905..3b1acf7dd5a19d1a555f1b89edbabb54853496e5 100644 (file)
@@ -74,7 +74,7 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser {
                $data = "";
 
                // Get member class
-               $userClass = $this->getConfigInstance()->readConfig('user_class');
+               $userClass = $this->getConfigInstance()->getConfigEntry('user_class');
 
                // Get a user instance
                $userInstance = call_user_func_array(array($userClass, 'createMemberByRequest'), array($requestInstance));
index c31a624a11024de209a37c7cedb351bb9fd23b3b..32da33fe2b45de746b7c8dead80a62647e6a9fe7 100644 (file)
@@ -85,7 +85,7 @@ class ShipSimuLoginHelper extends BaseLoginHelper implements HelpableLogin {
         * @return      void
         */
        protected function setDefaultAuthMethod () {
-               $this->authMethod = $this->getConfigInstance()->readConfig('auth_method_class');
+               $this->authMethod = $this->getConfigInstance()->getConfigEntry('auth_method_class');
        }
 
        /**
index 61d40b9b3c9d845ea0cd0b2b6634ee726e70c69c..31add01b47969e894506115b9ba019fd08da1401 100644 (file)
@@ -160,7 +160,7 @@ class ShipSimuRegistration extends BaseRegistration implements UserRegister {
                $configEntry = 'user_status_unconfirmed';
 
                // Is the confirmation process entirely disabled?
-               if ($this->getConfigInstance()->readConfig('confirm_email_enabled') === "N") {
+               if ($this->getConfigInstance()->getConfigEntry('confirm_email_enabled') === "N") {
                        // No confirmation of email needed
                        $configEntry = 'user_status_confirmed';
                } // END - if
@@ -177,7 +177,7 @@ class ShipSimuRegistration extends BaseRegistration implements UserRegister {
                        }
 
                        // Is this a guest account?
-                       if ((($element == "username") || ($alias == "username")) && ($this->getRequestInstance()->getRequestElement($element) == $this->getConfigInstance()->readConfig('guest_login_user'))) {
+                       if ((($element == "username") || ($alias == "username")) && ($this->getRequestInstance()->getRequestElement($element) == $this->getConfigInstance()->getConfigEntry('guest_login_user'))) {
                                // Yes, then set the config entry to guest status
                                $configEntry = 'user_status_guest';
                        } // END - if
index 9e69db6a2281514faaa200e3718ebf0b275b08ed..27c8a8ee87727de949cff5a591a62f01c8399d46 100644 (file)
@@ -97,7 +97,7 @@ class WebGovernmentFailedCommandResolver extends BaseCommandResolver implements
                } // END - if
 
                // Is the command empty? Then fall back to default command
-               if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_web_command');
+               if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
 
                // Check if command is valid
                if ($this->isCommandValid($commandName) === false) {
@@ -133,7 +133,7 @@ class WebGovernmentFailedCommandResolver extends BaseCommandResolver implements
                $commandInstance = null;
 
                // Is the command empty? Then fall back to default command
-               if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_web_command');
+               if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
 
                // Check if command is valid
                if ($this->isCommandValid($commandName) === false) {
@@ -158,7 +158,7 @@ class WebGovernmentFailedCommandResolver extends BaseCommandResolver implements
         */
        private function loadCommand ($commandName) {
                // Cache default command
-               $defaultCommand = $this->getConfigInstance()->readConfig('default_web_command');
+               $defaultCommand = $this->getConfigInstance()->getConfigEntry('default_web_command');
 
                // Init command instance
                $commandInstance = null;
index 96a107f666b881d7c0da4e95b01b34474bda2ded..e77ba3e68920eae6fbf84cadd3f4b3a500e962c3 100644 (file)
@@ -40,7 +40,7 @@ class ShipSimuBaseUser extends BaseUser implements Registerable, Updateable {
         */
        public function ifUserCreatedMaximumAllowedCompanies () {
                // Get max allowed companies to found
-               $maxFound = $this->getConfigInstance()->readConfig('max_allowed_companies_found');
+               $maxFound = $this->getConfigInstance()->getConfigEntry('max_allowed_companies_found');
 
                // Now get a search criteria and set the user's name as criteria
                $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
index 5efdf8de819c0408b30593e7b309e98ef3f30d0a..b805f50340ec57aa62a722d3600520f50958ab5d 100644 (file)
@@ -131,7 +131,7 @@ class ShipSimuMember extends ShipSimuBaseUser implements ManageableMember, Booka
 
                // If there is no action use the default on
                if (is_null($lastAction)) {
-                       $lastAction = $this->getConfigInstance()->readConfig('login_default_action');
+                       $lastAction = $this->getConfigInstance()->getConfigEntry('login_default_action');
                } // END - if
 
                // Get a critieria instance
index d73db4b1b0f34564a2c447c08d4fe5dfe36085b9..3a188492a247996e7a59ca9c327a228d3466a088 100644 (file)
 
 // Is there an application helper instance? We need the method main() for
 // maining the application
-$app = call_user_func_array(array(FrameworkConfiguration::getInstance()->readConfig('app_helper_class'), 'getInstance'), array());
+$app = call_user_func_array(array(FrameworkConfiguration::getInstance()->getConfigEntry('app_helper_class'), 'getInstance'), array());
 
 // Some sanity checks
 if ((empty($app)) || (is_null($app))) {
        // Something went wrong!
        ApplicationEntryPoint::app_die(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because the helper class <span class=\"class_name\">%s</span> is not loaded.",
                $application,
-               FrameworkConfiguration::getInstance()->readConfig('app_helper_class')
+               FrameworkConfiguration::getInstance()->getConfigEntry('app_helper_class')
        ));
 } elseif (!is_object($app)) {
        // No object!
        ApplicationEntryPoint::app_die(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because &#39;app&#39; is not an object.",
                $application
        ));
-} elseif (!method_exists($app, FrameworkConfiguration::getInstance()->readConfig('entry_method'))) {
+} elseif (!method_exists($app, FrameworkConfiguration::getInstance()->getConfigEntry('entry_method'))) {
        // Method not found!
        ApplicationEntryPoint::app_die(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because the method <span class=\"method_name\">%s</span> is missing.",
                $application,
-               FrameworkConfiguration::getInstance()->readConfig('entry_method')
+               FrameworkConfiguration::getInstance()->getConfigEntry('entry_method')
        ));
 }
 
 // Call user function
-call_user_func_array(array($app, FrameworkConfiguration::getInstance()->readConfig('entry_method')), array());
+call_user_func_array(array($app, FrameworkConfiguration::getInstance()->getConfigEntry('entry_method')), array());
 
 // [EOF]
 ?>
index 005004646b5cee9d87e2ae89b499f8f675e6604d..cf898bf7dbb77fe8967570faa0a48e168b4c4a5c 100644 (file)
--- a/index.php
+++ b/index.php
@@ -80,13 +80,13 @@ final class ApplicationEntryPoint {
                $configInstance = FrameworkConfiguration::getInstance();
 
                // Do we have debug installation?
-               if (($configInstance->readConfig('product_install_mode') == 'productive') || ($silentMode === true)) {
+               if (($configInstance->getConfigEntry('product_install_mode') == 'productive') || ($silentMode === true)) {
                        // Abort here
                        die();
                } // END - if
 
                // Get some instances
-               $tpl = FrameworkConfiguration::getInstance()->readConfig('template_class');
+               $tpl = FrameworkConfiguration::getInstance()->getConfigEntry('template_class');
                $lang = LanguageSystem::getInstance();
 
                // Get response instance
@@ -190,13 +190,13 @@ final class ApplicationEntryPoint {
                require(self::detectCorePath() . '/inc/config.php');
 
                // Load all include files
-               require($cfg->readConfig('base_path') . 'inc/includes.php');
+               require($cfg->getConfigEntry('base_path') . 'inc/includes.php');
 
                // Load all framework classes
-               require($cfg->readConfig('base_path') . 'inc/classes.php');
+               require($cfg->getConfigEntry('base_path') . 'inc/classes.php');
 
                // Include the application selector
-               require($cfg->readConfig('base_path') . 'inc/selector.php');
+               require($cfg->getConfigEntry('base_path') . 'inc/selector.php');
        } // END - main()
 
 } // END - class