From 08c68734fbfae295f3b037529bdc9e57003464e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 28 Jul 2009 17:27:35 +0000 Subject: [PATCH] readConfig() is not naming convention, renamed to getConfigEntry() --- application/hub/data.php | 2 +- application/hub/init.php | 8 ++++---- application/hub/loader.php | 2 +- .../filter/node/class_NodeInitializationFilter.php | 2 +- application/hub/main/listener/class_BaseListener.php | 4 ++-- application/hub/main/nodes/boot/class_HubBootNode.php | 2 +- application/hub/main/nodes/class_BaseHubNode.php | 4 ++-- .../console/class_HubConsoleCommandResolver.php | 4 ++-- application/hub/starter.php | 10 +++++----- index.php | 10 +++++----- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/application/hub/data.php b/application/hub/data.php index aeb4450d0..d68aca482 100644 --- a/application/hub/data.php +++ b/application/hub/data.php @@ -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() ); diff --git a/application/hub/init.php b/application/hub/init.php index 944a222a7..915f478b4 100644 --- a/application/hub/init.php +++ b/application/hub/init.php @@ -36,17 +36,17 @@ $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'); // Get's our IP address $_SERVER['SERVER_ADDR'] = ConsoleTools::acquireSelfIPAddress(); diff --git a/application/hub/loader.php b/application/hub/loader.php index 0cabbda78..5b1f37c69 100644 --- a/application/hub/loader.php +++ b/application/hub/loader.php @@ -27,7 +27,7 @@ $cfg = FrameworkConfiguration::getInstance(); // Load all classes for the application foreach ($lowerClasses as $class) { // Try to load the application classes - ClassLoader::getInstance()->scanClassPath(sprintf("%s/%s/%s", $cfg->readConfig("application_path"), $cfg->readConfig("app_name"), $class)); + ClassLoader::getInstance()->scanClassPath(sprintf("%s/%s/%s", $cfg->getConfigEntry("application_path"), $cfg->getConfigEntry("app_name"), $class)); } // END - foreach // Clean up the global namespace diff --git a/application/hub/main/filter/node/class_NodeInitializationFilter.php b/application/hub/main/filter/node/class_NodeInitializationFilter.php index c8c48ada7..40cb4046b 100644 --- a/application/hub/main/filter/node/class_NodeInitializationFilter.php +++ b/application/hub/main/filter/node/class_NodeInitializationFilter.php @@ -55,7 +55,7 @@ class NodeInitializationFilter extends BaseFilter implements Filterable { */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // The default node-mode is from our configuration - $nodeMode = $this->getConfigInstance()->readConfig('node_mode'); + $nodeMode = $this->getConfigInstance()->getConfigEntry('node_mode'); // Is the node 'mode' parameter set? if ($requestInstance->isRequestElementSet('mode')) { diff --git a/application/hub/main/listener/class_BaseListener.php b/application/hub/main/listener/class_BaseListener.php index 31809ff5a..40c91c5c8 100644 --- a/application/hub/main/listener/class_BaseListener.php +++ b/application/hub/main/listener/class_BaseListener.php @@ -111,7 +111,7 @@ class BaseListener extends BaseHubSystem { * @return void */ public final function setListenAddressByConfiguration ($configEntry) { - $this->setListenAddress($this->getConfigInstance()->readConfig($configEntry)); + $this->setListenAddress($this->getConfigInstance()->getConfigEntry($configEntry)); } /** @@ -121,7 +121,7 @@ class BaseListener extends BaseHubSystem { * @return void */ public final function setListenPortByConfiguration ($configEntry) { - $this->setListenPort($this->getConfigInstance()->readConfig($configEntry)); + $this->setListenPort($this->getConfigInstance()->getConfigEntry($configEntry)); } /** diff --git a/application/hub/main/nodes/boot/class_HubBootNode.php b/application/hub/main/nodes/boot/class_HubBootNode.php index ff55bcd77..7696c1bea 100644 --- a/application/hub/main/nodes/boot/class_HubBootNode.php +++ b/application/hub/main/nodes/boot/class_HubBootNode.php @@ -61,7 +61,7 @@ class HubBootNode extends BaseHubNode implements NodeHelper, Registerable { // Now check if the IP address matches one of the bootstrap nodes if ($this->ifAddressMatchesBootstrappingNodes($_SERVER['SERVER_ADDR'])) { // Get our port from configuration - $ourPort = $this->getConfigInstance()->readConfig('node_tcp_listen_port'); + $ourPort = $this->getConfigInstance()->getConfigEntry('node_tcp_listen_port'); // Extract port $bootPort = substr($this->getBootIpPort(), -strlen($ourPort), strlen($ourPort)); diff --git a/application/hub/main/nodes/class_BaseHubNode.php b/application/hub/main/nodes/class_BaseHubNode.php index ec335ef45..07045edd8 100644 --- a/application/hub/main/nodes/class_BaseHubNode.php +++ b/application/hub/main/nodes/class_BaseHubNode.php @@ -107,7 +107,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable { $isFound = false; // Run through all configured IPs - foreach (explode(',', $this->getConfigInstance()->readConfig('hub_bootstrap_nodes')) as $ipPort) { + foreach (explode(',', $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $ipPort) { // Split it up in IP/port $ipPortArray = explode(':', $ipPort); @@ -124,7 +124,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable { // Stop further searching break; - } elseif ($ipPortArray[0] == $this->getConfigInstance()->readConfig('node_listen_addr')) { + } elseif ($ipPortArray[0] == $this->getConfigInstance()->getConfigEntry('node_listen_addr')) { // IP matches listen address. At this point we really don't care // if we can also listen on that address! $isFound = true; diff --git a/application/hub/main/resolver/command/console/class_HubConsoleCommandResolver.php b/application/hub/main/resolver/command/console/class_HubConsoleCommandResolver.php index 342d1f76c..f5a7fe1bd 100644 --- a/application/hub/main/resolver/command/console/class_HubConsoleCommandResolver.php +++ b/application/hub/main/resolver/command/console/class_HubConsoleCommandResolver.php @@ -89,7 +89,7 @@ class HubConsoleCommandResolver extends BaseCommandResolver implements CommandRe $commandName = $requestInstance->getRequestElement('command'); // Is the command empty? Then fall back to default command - if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_console_command'); + if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_console_command'); // Check if command is valid if ($this->isCommandValid($commandName) === false) { @@ -125,7 +125,7 @@ class HubConsoleCommandResolver extends BaseCommandResolver implements CommandRe $commandInstance = null; // Is the command empty? Then fall back to default command - if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_console_command'); + if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_console_command'); // Check if command is valid if ($this->isCommandValid($commandName) === false) { diff --git a/application/hub/starter.php b/application/hub/starter.php index a177f0f83..39633a9fa 100644 --- a/application/hub/starter.php +++ b/application/hub/starter.php @@ -26,7 +26,7 @@ // maining the application $app = call_user_func_array( array( - FrameworkConfiguration::getInstance()->readConfig('app_helper_class'), 'getInstance' + FrameworkConfiguration::getInstance()->getConfigEntry('app_helper_class'), 'getInstance' ), array() ); @@ -35,23 +35,23 @@ if ((empty($app)) || (is_null($app))) { // Something went wrong! ApplicationEntryPoint::app_die(sprintf("[Main:] The application %s could not be launched because the helper class %s 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 %s could not be launched because 'app' 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 %s could not be launched because the method %s 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] ?> diff --git a/index.php b/index.php index 005004646..cf898bf7d 100644 --- 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 -- 2.39.5