Now all cfgInstance are rewritten to configInstance
authorRoland Häder <roland@mxchange.org>
Fri, 13 Mar 2009 13:45:51 +0000 (13:45 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 13 Mar 2009 13:45:51 +0000 (13:45 +0000)
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/template/image/class_ImageTemplateEngine.php
inc/classes/main/template/mail/class_MailTemplateEngine.php
inc/classes/main/template/web/class_WebTemplateEngine.php
inc/config/class_FrameworkConfiguration.php
inc/loader/class_ClassLoader.php

index acea78d..e635ab5 100644 (file)
@@ -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;
        }
 
        /**
index e5da613..c77556a 100644 (file)
@@ -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;
index 8746c87..d67651f 100644 (file)
@@ -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;
index 047bb4d..fbd5d57 100644 (file)
@@ -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;
index e9610ed..fafc68f 100644 (file)
@@ -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;
        }
 
        /**
index 775abf6..ffa0793 100644 (file)
@@ -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);