From: Roland Häder Date: Fri, 13 Mar 2009 13:45:51 +0000 (+0000) Subject: Now all cfgInstance are rewritten to configInstance X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=79c811f0b38576d74bdce4f6b3ae811ac003ebe0;p=core.git Now all cfgInstance are rewritten to configInstance --- diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index acea78de..e635ab55 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -403,11 +403,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { /** * Getter for configuration instance * - * @return $cfgInstance Configuration instance + * @return $configInstance Configuration instance */ public final function getConfigInstance () { - $cfgInstance = Registry::getRegistry()->getInstance('config'); - return $cfgInstance; + $configInstance = Registry::getRegistry()->getInstance('config'); + return $configInstance; } /** diff --git a/inc/classes/main/template/image/class_ImageTemplateEngine.php b/inc/classes/main/template/image/class_ImageTemplateEngine.php index e5da6137..c77556a4 100644 --- a/inc/classes/main/template/image/class_ImageTemplateEngine.php +++ b/inc/classes/main/template/image/class_ImageTemplateEngine.php @@ -86,7 +86,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl } // Get configuration instance - $cfgInstance = FrameworkConfiguration::getInstance(); + $configInstance = FrameworkConfiguration::getInstance(); // Set the base path $tplInstance->setBasePath($basePath); @@ -96,11 +96,11 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl $tplInstance->setFileIoInstance($ioInstance); // Set template extensions - $tplInstance->setRawTemplateExtension($cfgInstance->readConfig('raw_template_extension')); - $tplInstance->setCodeTemplateExtension($cfgInstance->readConfig('code_template_extension')); + $tplInstance->setRawTemplateExtension($configInstance->readConfig('raw_template_extension')); + $tplInstance->setCodeTemplateExtension($configInstance->readConfig('code_template_extension')); // Absolute output path for compiled templates - $tplInstance->setCompileOutputPath($cfgInstance->readConfig('base_path') . $cfgInstance->readConfig('compile_output_path')); + $tplInstance->setCompileOutputPath($configInstance->readConfig('base_path') . $configInstance->readConfig('compile_output_path')); // Return the prepared instance return $tplInstance; diff --git a/inc/classes/main/template/mail/class_MailTemplateEngine.php b/inc/classes/main/template/mail/class_MailTemplateEngine.php index 8746c878..d67651fb 100644 --- a/inc/classes/main/template/mail/class_MailTemplateEngine.php +++ b/inc/classes/main/template/mail/class_MailTemplateEngine.php @@ -86,7 +86,7 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla } // Get configuration instance - $cfgInstance = FrameworkConfiguration::getInstance(); + $configInstance = FrameworkConfiguration::getInstance(); // Set the base path $tplInstance->setBasePath($basePath); @@ -96,11 +96,11 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla $tplInstance->setFileIoInstance($ioInstance); // Set template extensions - $tplInstance->setRawTemplateExtension($cfgInstance->readConfig('raw_template_extension')); - $tplInstance->setCodeTemplateExtension($cfgInstance->readConfig('code_template_extension')); + $tplInstance->setRawTemplateExtension($configInstance->readConfig('raw_template_extension')); + $tplInstance->setCodeTemplateExtension($configInstance->readConfig('code_template_extension')); // Absolute output path for compiled templates - $tplInstance->setCompileOutputPath($cfgInstance->readConfig('base_path') . $cfgInstance->readConfig('compile_output_path')); + $tplInstance->setCompileOutputPath($configInstance->readConfig('base_path') . $configInstance->readConfig('compile_output_path')); // Return the prepared instance return $tplInstance; diff --git a/inc/classes/main/template/web/class_WebTemplateEngine.php b/inc/classes/main/template/web/class_WebTemplateEngine.php index 047bb4d0..fbd5d572 100644 --- a/inc/classes/main/template/web/class_WebTemplateEngine.php +++ b/inc/classes/main/template/web/class_WebTemplateEngine.php @@ -67,7 +67,7 @@ class WebTemplateEngine extends BaseTemplateEngine implements CompileableTemplat } // Get configuration instance - $cfgInstance = FrameworkConfiguration::getInstance(); + $configInstance = FrameworkConfiguration::getInstance(); // Set the base path $tplInstance->setBasePath($basePath); @@ -77,11 +77,11 @@ class WebTemplateEngine extends BaseTemplateEngine implements CompileableTemplat $tplInstance->setFileIoInstance($ioInstance); // Set template extensions - $tplInstance->setRawTemplateExtension($cfgInstance->readConfig('raw_template_extension')); - $tplInstance->setCodeTemplateExtension($cfgInstance->readConfig('code_template_extension')); + $tplInstance->setRawTemplateExtension($configInstance->readConfig('raw_template_extension')); + $tplInstance->setCodeTemplateExtension($configInstance->readConfig('code_template_extension')); // Absolute output path for compiled templates - $tplInstance->setCompileOutputPath($cfgInstance->readConfig('base_path') . $cfgInstance->readConfig('compile_output_path')); + $tplInstance->setCompileOutputPath($configInstance->readConfig('base_path') . $configInstance->readConfig('compile_output_path')); // Return the prepared instance return $tplInstance; diff --git a/inc/config/class_FrameworkConfiguration.php b/inc/config/class_FrameworkConfiguration.php index e9610ed2..fafc68fd 100644 --- a/inc/config/class_FrameworkConfiguration.php +++ b/inc/config/class_FrameworkConfiguration.php @@ -36,7 +36,7 @@ class FrameworkConfiguration implements Registerable { /** * The configuration instance itself */ - private static $cfgInstance = null; + private static $configInstance = null; // Some constants for the configuration system const EXCEPTION_CONFIG_ENTRY_IS_EMPTY = 0x130; @@ -54,16 +54,16 @@ class FrameworkConfiguration implements Registerable { /** * Getter for an instance of this class * - * @return $cfgInstance An instance of this class + * @return $configInstance An instance of this class */ public final static function getInstance () { // is the instance there? - if (is_null(self::$cfgInstance)) { + if (is_null(self::$configInstance)) { // Create a config instance - self::$cfgInstance = new FrameworkConfiguration(); + self::$configInstance = new FrameworkConfiguration(); } // END - if - return self::$cfgInstance; + return self::$configInstance; } /** diff --git a/inc/loader/class_ClassLoader.php b/inc/loader/class_ClassLoader.php index 775abf6b..ffa07930 100644 --- a/inc/loader/class_ClassLoader.php +++ b/inc/loader/class_ClassLoader.php @@ -25,7 +25,7 @@ * 1.3 * - Constructor is now empty and factory method 'createClassLoader' is created * - renamed loadClasses to scanClassPath - * - Added initLoader(), $cfgInstance renamed to $configInstance + * - Added initLoader(), $configInstance renamed to $configInstance * 1.2 * - ClassLoader rewritten to PHP SPL's own RecursiveIteratorIterator class * 1.1 @@ -40,11 +40,6 @@ class ClassLoader { */ private static $selfInstance = null; - /** - * Configuration array - */ - private $cfg = array(); - /** * Array with all classes */ @@ -136,12 +131,12 @@ class ClassLoader { */ protected function initLoader (FrameworkConfiguration $configInstance) { // Set configuration instance - $this->cfgInstance = $configInstance; + $this->configInstance = $configInstance; // Construct the FQFN for the cache if (!defined('DEVELOPER')) { - $this->listCacheFQFN = $this->cfgInstance->readConfig('local_db_path') . "list-" . $this->cfgInstance->readConfig('app_name') . ".cache"; - $this->classCacheFQFN = $this->cfgInstance->readConfig('local_db_path') . "class-" . $this->cfgInstance->readConfig('app_name') . ".cache"; + $this->listCacheFQFN = $this->configInstance->readConfig('local_db_path') . "list-" . $this->configInstance->readConfig('app_name') . ".cache"; + $this->classCacheFQFN = $this->configInstance->readConfig('local_db_path') . "class-" . $this->configInstance->readConfig('app_name') . ".cache"; } // END - if // Set suffix and prefix from configuration @@ -320,7 +315,7 @@ class ClassLoader { $this->prefix = "config-"; // Set base directory - $basePath = sprintf("%sinc/config/", $this->cfgInstance->readConfig('base_path')); + $basePath = sprintf("%sinc/config/", $this->configInstance->readConfig('base_path')); // Load all classes from the config directory $this->scanClassPath($basePath);