Rewrite:
authorRoland Häder <roland@mxchange.org>
Sun, 13 Aug 2017 18:36:12 +0000 (20:36 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 13 Aug 2017 18:36:12 +0000 (20:36 +0200)
- the configuration instance is now instanciated by
  FrameworkBootstrap::getConfigurationInstance(), this *may* has made it sure
  that the class FrameworkConfiguration can be fully covered by unit tests.
- still a call-back instance test is pending

Signed-off-by: Roland Häder <roland@mxchange.org>
17 files changed:
application/tests/class_ApplicationHelper.php
application/tests/config.php
framework/bootstrap/class_FrameworkBootstrap.php
framework/config-global.php
framework/config/class_FrameworkConfiguration.php
framework/loader/class_ClassLoader.php
framework/main/classes/class_BaseFrameworkSystem.php
framework/main/classes/factories/objects/class_ObjectFactory.php
framework/main/classes/factories/stacks/class_FileStackFactory.php
framework/main/classes/factories/user/class_UserFactory.php
framework/main/classes/feature/class_FrameworkFeature.php
framework/main/classes/language/class_LanguageSystem.php
framework/main/classes/output/console/class_ConsoleOutput.php
framework/main/classes/tools/console/class_ConsoleTools.php
index.php
tests/bootstrap.php
tests/framework/config/FrameworkConfigurationTest.php

index 6b234b436defa8a230624c09df15676c49ebe1b7..cc0f574983ff6c627d5187127f255b278ff09d43 100644 (file)
@@ -4,7 +4,6 @@ namespace CoreFramework\Helper\Application;
 
 // Import framework stuff
 use CoreFramework\Bootstrap\FrameworkBootstrap;
 
 // Import framework stuff
 use CoreFramework\Bootstrap\FrameworkBootstrap;
-use CoreFramework\Configuration\FrameworkConfiguration;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Loader\ClassLoader;
 use CoreFramework\Manager\ManageableApplication;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Loader\ClassLoader;
 use CoreFramework\Manager\ManageableApplication;
@@ -176,7 +175,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
         */
        public function initApplication () {
                // Get config instance
         */
        public function initApplication () {
                // Get config instance
-               $cfg = FrameworkConfiguration::getSelfInstance();
+               $cfg = FrameworkBootstrap::getConfigurationInstance();
 
                // Initialize output system
                self::createDebugInstance('ApplicationHelper');
 
                // Initialize output system
                self::createDebugInstance('ApplicationHelper');
index 0574a8db66399f1c817d87e566a788bb55d91780..3a0ee3e9427e46b41d4d7a583e07f361dafdc827 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Import framework stuff
 <?php
 // Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 
 /**
  * Configuration entries for this application only
 
 /**
  * Configuration entries for this application only
@@ -25,7 +25,7 @@ use CoreFramework\Configuration\FrameworkConfiguration;
  */
 
 // Some hub-specific configuration like port hostname where we will listen, etc.
  */
 
 // Some hub-specific configuration like port hostname where we will listen, etc.
-$cfg = FrameworkConfiguration::getSelfInstance();
+$cfg = FrameworkBootstrap::getConfigurationInstance();
 
 // CFG: DEFAULT-CONSOLE-COMMAND
 $cfg->setConfigEntry('default_console_command', 'main');
 
 // CFG: DEFAULT-CONSOLE-COMMAND
 $cfg->setConfigEntry('default_console_command', 'main');
index a37c6bf95a8200fa770050389d007f1e52331033..2b79f2c4631396e03435e4be55c536a84b062815 100644 (file)
@@ -63,6 +63,11 @@ final class FrameworkBootstrap {
         */
        private static $responseInstance = NULL;
 
         */
        private static $responseInstance = NULL;
 
+       /**
+        * Instance of a FrameworkConfiguration class
+        */
+       private static $configurationInstance = NULL;
+
        /*
         * Includes applications may have. They will be tried in the given order,
         * some will become soon deprecated.
        /*
         * Includes applications may have. They will be tried in the given order,
         * some will become soon deprecated.
@@ -96,6 +101,22 @@ final class FrameworkBootstrap {
                // Prevent making instances from this "utilities" class
        }
 
                // Prevent making instances from this "utilities" class
        }
 
+       /**
+        * Some "getter" for a configuration instance, making sure, it is unique
+        *
+        * @return      $configurationInstance  An instance of a FrameworkConfiguration class
+        */
+       public static function getConfigurationInstance () {
+               // Is the instance there?
+               if (is_null(self::$configurationInstance)) {
+                       // Init new instance
+                       self::$configurationInstance = new FrameworkConfiguration();
+               } // END - if
+
+               // Return it
+               return self::$configurationInstance;
+       }
+
        /**
         * Getter for request instance
         *
        /**
         * Getter for request instance
         *
@@ -277,8 +298,8 @@ final class FrameworkBootstrap {
         */
        public static function prepareApplication () {
                // Configuration entry 'detected_app_name' must be set, get it here, including full path
         */
        public static function prepareApplication () {
                // Configuration entry 'detected_app_name' must be set, get it here, including full path
-               $application = FrameworkConfiguration::getSelfInstance()->getConfigEntry('detected_app_name');
-               $fullPath    = FrameworkConfiguration::getSelfInstance()->getConfigEntry('detected_full_app_path');
+               $application = self::getConfigurationInstance()->getConfigEntry('detected_app_name');
+               $fullPath    = self::getConfigurationInstance()->getConfigEntry('detected_full_app_path');
 
                /*
                 * Now check and load all files, found deprecated files will throw a
 
                /*
                 * Now check and load all files, found deprecated files will throw a
@@ -325,7 +346,7 @@ final class FrameworkBootstrap {
         */
        public static function startApplication () {
                // Configuration entry 'detected_app_name' must be set, get it here
         */
        public static function startApplication () {
                // Configuration entry 'detected_app_name' must be set, get it here
-               $application = FrameworkConfiguration::getSelfInstance()->getConfigEntry('detected_app_name');
+               $application = self::getConfigurationInstance()->getConfigEntry('detected_app_name');
 
                // Is there an application helper instance?
                $applicationInstance = call_user_func_array(
 
                // Is there an application helper instance?
                $applicationInstance = call_user_func_array(
@@ -383,7 +404,7 @@ final class FrameworkBootstrap {
                } // END - if
 
                // Initialize database layer
                } // END - if
 
                // Initialize database layer
-               $databaseInstance = ObjectFactory::createObjectByConfiguredName(FrameworkConfiguration::getSelfInstance()->getConfigEntry('database_type') . '_class');
+               $databaseInstance = ObjectFactory::createObjectByConfiguredName(self::getConfigurationInstance()->getConfigEntry('database_type') . '_class');
 
                // Prepare database instance
                $connectionInstance = DatabaseConnection::createDatabaseConnection(DebugMiddleware::getSelfInstance(), $databaseInstance);
 
                // Prepare database instance
                $connectionInstance = DatabaseConnection::createDatabaseConnection(DebugMiddleware::getSelfInstance(), $databaseInstance);
@@ -550,7 +571,7 @@ final class FrameworkBootstrap {
         */
        private static function scanFrameworkClasses () {
                // Include the class loader function
         */
        private static function scanFrameworkClasses () {
                // Include the class loader function
-               require FrameworkConfiguration::getSelfInstance()->getConfigEntry('framework_base_path') . 'loader/class_ClassLoader.php';
+               require self::getConfigurationInstance()->getConfigEntry('framework_base_path') . 'loader/class_ClassLoader.php';
 
                // Register auto-load function with the SPL
                spl_autoload_register('CoreFramework\Loader\ClassLoader::autoLoad');
 
                // Register auto-load function with the SPL
                spl_autoload_register('CoreFramework\Loader\ClassLoader::autoLoad');
@@ -619,7 +640,7 @@ final class FrameworkBootstrap {
                // Construct FQPN (Full-Qualified Path Name) for ApplicationHelper class
                $applicationPath = sprintf(
                        '%s%s%s',
                // Construct FQPN (Full-Qualified Path Name) for ApplicationHelper class
                $applicationPath = sprintf(
                        '%s%s%s',
-                       FrameworkConfiguration::getSelfInstance()->getConfigEntry('application_base_path'),
+                       self::getConfigurationInstance()->getConfigEntry('application_base_path'),
                        $application,
                        DIRECTORY_SEPARATOR
                );
                        $application,
                        DIRECTORY_SEPARATOR
                );
@@ -632,8 +653,8 @@ final class FrameworkBootstrap {
                } // END - if
 
                // Set the detected application's name and full path for later usage
                } // END - if
 
                // Set the detected application's name and full path for later usage
-               FrameworkConfiguration::getSelfInstance()->setConfigEntry('detected_full_app_path', $applicationPath);
-               FrameworkConfiguration::getSelfInstance()->setConfigEntry('detected_app_name'     , $application);
+               self::getConfigurationInstance()->setConfigEntry('detected_full_app_path', $applicationPath);
+               self::getConfigurationInstance()->setConfigEntry('detected_app_name'     , $application);
        }
        /**
         * Setter for request instance
        }
        /**
         * Setter for request instance
index bf734267fea51f73d3ec970745bff6c3d55747dd..bd1623187d6c55359f5ffbd0b3b43756b71e681d 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 // Import framework stuff
 <?php
 // Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
 use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\EntryPoint\ApplicationEntryPoint;
 
 use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\EntryPoint\ApplicationEntryPoint;
 
@@ -30,7 +29,7 @@ use CoreFramework\EntryPoint\ApplicationEntryPoint;
  */
 
 // Get a new configuration instance
  */
 
 // Get a new configuration instance
-$cfg = FrameworkConfiguration::getSelfInstance();
+$cfg = FrameworkBootstrap::getConfigurationInstance();
 
 // CFG: ROOT-BASE-PATH
 $cfg->setConfigEntry('root_base_path', ApplicationEntryPoint::getRootPath() . DIRECTORY_SEPARATOR);
 
 // CFG: ROOT-BASE-PATH
 $cfg->setConfigEntry('root_base_path', ApplicationEntryPoint::getRootPath() . DIRECTORY_SEPARATOR);
index 82d50bf964606d4882a619806f11fa96178122fc..0826076e41a5f1b077ad3fbf62e41ac07a8cd46f 100644 (file)
@@ -48,12 +48,7 @@ class FrameworkConfiguration implements Registerable {
         * hard-coded configuration data and might be overwritten/extended by
         * config data from the database.
         */
         * hard-coded configuration data and might be overwritten/extended by
         * config data from the database.
         */
-       private $config = array();
-
-       /**
-        * The configuration instance itself
-        */
-       private static $configInstance = NULL;
+       private static $config = array();
 
        /**
         * Call-back instance (unused)
 
        /**
         * Call-back instance (unused)
@@ -66,11 +61,12 @@ class FrameworkConfiguration implements Registerable {
        const EXCEPTION_CONFIG_VALUE_TYPE_UNSUPPORTED = 0x132;
 
        /**
        const EXCEPTION_CONFIG_VALUE_TYPE_UNSUPPORTED = 0x132;
 
        /**
-        * Private constructor
+        * Default constructor, the configuration entries are static, not the
+        * whole instance.
         *
         * @return      void
         */
         *
         * @return      void
         */
-       private function __construct () {
+       public function __construct () {
                // Empty for now
        }
 
                // Empty for now
        }
 
@@ -83,22 +79,6 @@ class FrameworkConfiguration implements Registerable {
                return get_class($this);
        }
 
                return get_class($this);
        }
 
-       /**
-        * Getter for a singleton instance of this class
-        *
-        * @return      $configInstance         A singleton instance of this class
-        */
-       public static final function getSelfInstance () {
-               // is the instance there?
-               if (is_null(self::$configInstance)) {
-                       // Create a config instance
-                       self::$configInstance = new FrameworkConfiguration();
-               } // END - if
-
-               // Return singleton instance
-               return self::$configInstance;
-       }
-
        /**
         * Checks whether the given configuration key is set
         *
        /**
         * Checks whether the given configuration key is set
         *
@@ -121,7 +101,7 @@ class FrameworkConfiguration implements Registerable {
                }
 
                // Is it set?
                }
 
                // Is it set?
-               $isset = ((isset($this->config[$configKey])) || (array_key_exists($configKey, $this->config)));
+               $isset = ((isset(self::$config[$configKey])) || (array_key_exists($configKey, self::$config)));
 
                // Return the result
                return $isset;
 
                // Return the result
                return $isset;
@@ -159,7 +139,7 @@ class FrameworkConfiguration implements Registerable {
                } // END - if
 
                // Return the requested value
                } // END - if
 
                // Return the requested value
-               return $this->config[$configKey];
+               return self::$config[$configKey];
        }
 
        /**
        }
 
        /**
@@ -193,10 +173,10 @@ class FrameworkConfiguration implements Registerable {
 
                // Set the configuration value
                //* NOISY-DEBUG: */ print(__METHOD__ . ':configEntry=' . $configKey . ',configValue[' . gettype($configValue) . ']=' . $configValue . PHP_EOL);
 
                // Set the configuration value
                //* NOISY-DEBUG: */ print(__METHOD__ . ':configEntry=' . $configKey . ',configValue[' . gettype($configValue) . ']=' . $configValue . PHP_EOL);
-               $this->config[$configKey] = $configValue;
+               self::$config[$configKey] = $configValue;
 
                // Resort the array
 
                // Resort the array
-               ksort($this->config);
+               ksort(self::$config);
        }
 
        /**
        }
 
        /**
@@ -206,7 +186,7 @@ class FrameworkConfiguration implements Registerable {
         */
        public final function getConfigurationArray () {
                // Return it
         */
        public final function getConfigurationArray () {
                // Return it
-               return $this->config;
+               return self::$config;
        }
 
        /**
        }
 
        /**
@@ -242,7 +222,7 @@ class FrameworkConfiguration implements Registerable {
                } // END - if
 
                // Unset it
                } // END - if
 
                // Unset it
-               unset($this->config[$configKey]);
+               unset(self::$config[$configKey]);
        }
 
        /**
        }
 
        /**
index 63f6d00d280c83ba0fee3277b74321c7a814ab64..5ae12d7779cb62bf75801b4f6a92598bc6b111f8 100644 (file)
@@ -220,7 +220,7 @@ class ClassLoader {
                $loaderInstance = self::getSelfInstance();
 
                // Get config instance
                $loaderInstance = self::getSelfInstance();
 
                // Get config instance
-               $configInstance = FrameworkConfiguration::getSelfInstance();
+               $configInstance = FrameworkBootstrap::getConfigurationInstance();
 
                // Load all classes
                foreach (self::$frameworkPaths as $shortPath) {
 
                // Load all classes
                foreach (self::$frameworkPaths as $shortPath) {
@@ -269,7 +269,7 @@ class ClassLoader {
                $loaderInstance = self::getSelfInstance();
 
                // Get config instance
                $loaderInstance = self::getSelfInstance();
 
                // Get config instance
-               $configInstance = FrameworkConfiguration::getSelfInstance();
+               $configInstance = FrameworkBootstrap::getConfigurationInstance();
 
                // Load all classes for the application
                foreach (self::$frameworkPaths as $shortPath) {
 
                // Load all classes for the application
                foreach (self::$frameworkPaths as $shortPath) {
@@ -310,7 +310,7 @@ class ClassLoader {
                //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
 
                // Get config instance
                //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
 
                // Get config instance
-               $configInstance = FrameworkConfiguration::getSelfInstance();
+               $configInstance = FrameworkBootstrap::getConfigurationInstance();
 
                // Load all classes for the application
                foreach (self::$testPaths as $shortPath) {
 
                // Load all classes for the application
                foreach (self::$testPaths as $shortPath) {
@@ -399,7 +399,7 @@ class ClassLoader {
                // Is the instance there?
                if (is_null(self::$selfInstance)) {
                        // Get a new one
                // Is the instance there?
                if (is_null(self::$selfInstance)) {
                        // Get a new one
-                       self::$selfInstance = ClassLoader::createClassLoader(FrameworkConfiguration::getSelfInstance());
+                       self::$selfInstance = ClassLoader::createClassLoader(FrameworkBootstrap::getConfigurationInstance());
                } // END - if
 
                // Return the instance
                } // END - if
 
                // Return the instance
index 2d9aa984a4c0102d7cc91596fb616e1abddcd56d..f88b8d36fe5732c3bda6a80144c5dab92d2236fb 100644 (file)
@@ -466,7 +466,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Set configuration instance if no registry ...
                if (!$this instanceof Register) {
                        // ... because registries doesn't need to be configured
                // Set configuration instance if no registry ...
                if (!$this instanceof Register) {
                        // ... because registries doesn't need to be configured
-                       $this->setConfigInstance(FrameworkConfiguration::getSelfInstance());
+                       $this->setConfigInstance(FrameworkBootstrap::getConfigurationInstance());
                } // END - if
 
                // Is the startup time set? (0 cannot be true anymore)
                } // END - if
 
                // Is the startup time set? (0 cannot be true anymore)
@@ -1853,7 +1853,7 @@ Loaded includes:
                        // Try it
                        try {
                                // Get a debugger instance
                        // Try it
                        try {
                                // Get a debugger instance
-                               $debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getSelfInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_class'), $className);
+                               $debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_class'), $className);
                        } catch (NullPointerException $e) {
                                // Didn't work, no instance there
                                exit(sprintf('Cannot create debugInstance! Exception=%s,message=%s,className=%s,lineNumber=%d' . PHP_EOL, $e->__toString(), $e->getMessage(), $className, $lineNumber));
                        } catch (NullPointerException $e) {
                                // Didn't work, no instance there
                                exit(sprintf('Cannot create debugInstance! Exception=%s,message=%s,className=%s,lineNumber=%d' . PHP_EOL, $e->__toString(), $e->getMessage(), $className, $lineNumber));
@@ -3299,7 +3299,7 @@ Loaded includes:
         */
         protected static function createTempPathForFile (SplFileInfo $infoInstance) {
                // Get config entry
         */
         protected static function createTempPathForFile (SplFileInfo $infoInstance) {
                // Get config entry
-               $basePath = FrameworkConfiguration::getSelfInstance()->getConfigEntry('temp_file_path');
+               $basePath = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('temp_file_path');
 
                // Is the path writeable?
                if (!is_writable($basePath)) {
 
                // Is the path writeable?
                if (!is_writable($basePath)) {
index ebde62499338fe56c3bfe666bd45da5c4955cf60..2701ede9a53ffb256197a2f6fd233c31d37602b6 100644 (file)
@@ -3,7 +3,7 @@
 namespace CoreFramework\Factory;
 
 // Import framework stuff
 namespace CoreFramework\Factory;
 
 // Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Generic\EmptyVariableException;
 use CoreFramework\Loader\NoClassException;
 
 use CoreFramework\Generic\EmptyVariableException;
 use CoreFramework\Loader\NoClassException;
 
@@ -97,7 +97,7 @@ class ObjectFactory extends BaseFactory {
         */
        public static final function createObjectByConfiguredName ($configEntry, array $args = array()) {
                // Read the configuration entry
         */
        public static final function createObjectByConfiguredName ($configEntry, array $args = array()) {
                // Read the configuration entry
-               $className = FrameworkConfiguration::getSelfInstance()->getConfigEntry($configEntry);
+               $className = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry);
 
                // Send this to the other factory...
                $objectInstance = self::createObjectByName($className, $args);
 
                // Send this to the other factory...
                $objectInstance = self::createObjectByName($className, $args);
index 957810fbfe35bad3b4fe4bf15bf6d08868545b1b..6ce4332d5034f7692fe21682342b9e8ec45f31c6 100644 (file)
@@ -3,7 +3,7 @@
 namespace CoreFramework\Factory\Stack;
 
 // Import framework stuff
 namespace CoreFramework\Factory\Stack;
 
 // Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Registry\Registry;
 
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Registry\Registry;
 
@@ -50,10 +50,10 @@ class FileStackFactory extends ObjectFactory {
        public static final function createFileStackInstance ($prefix, $stackName) {
                // Construct file stack name
                $stackFileName = sprintf('%s%s/%s.%s',
        public static final function createFileStackInstance ($prefix, $stackName) {
                // Construct file stack name
                $stackFileName = sprintf('%s%s/%s.%s',
-                       FrameworkConfiguration::getSelfInstance()->getConfigEntry('framework_base_path'),
-                       FrameworkConfiguration::getSelfInstance()->getConfigEntry('base_file_stacks_path'),
+                       FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('framework_base_path'),
+                       FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('base_file_stacks_path'),
                        $stackName,
                        $stackName,
-                       FrameworkConfiguration::getSelfInstance()->getConfigEntry('file_stacks_extension')
+                       FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('file_stacks_extension')
                );
 
                // If there is no handler?
                );
 
                // If there is no handler?
index 3e15d02815bc8909ec72be57655a7ac747c47e66..80602114b5aa80c92cfdc38081b38b2ebe90a4f5 100644 (file)
@@ -3,7 +3,7 @@
 namespace CoreFramework\Factory\User;
 
 // Import framework stuff
 namespace CoreFramework\Factory\User;
 
 // Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Registry\Registry;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Registry\Registry;
 use CoreFramework\Request\Requestable;
@@ -59,13 +59,13 @@ class UserFactory extends ObjectFactory {
                        // Probe on member instance
                        try {
                                // Get class name
                        // Probe on member instance
                        try {
                                // Get class name
-                               $className = FrameworkConfiguration::getSelfInstance()->getConfigEntry('user_class');
+                               $className = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_class');
 
                                // Try to instance it
                                $userInstance = call_user_func_array(array($className, 'createMemberByRequest'), array($requestInstance));
                        } catch (UnexpectedGuestAccountException $e) {
                                // Then try it with guest account
 
                                // Try to instance it
                                $userInstance = call_user_func_array(array($className, 'createMemberByRequest'), array($requestInstance));
                        } catch (UnexpectedGuestAccountException $e) {
                                // Then try it with guest account
-                               $className = FrameworkConfiguration::getSelfInstance()->getConfigEntry('guest_class');
+                               $className = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_class');
 
                                // Try to instance it
                                $userInstance = call_user_func_array(array($className, 'createGuestByRequest'), array($requestInstance));
 
                                // Try to instance it
                                $userInstance = call_user_func_array(array($className, 'createGuestByRequest'), array($requestInstance));
index 09fa8263f58fab5def63b829426108fb4251edfb..6f0c55c99e927a52678be68723b04f877b235985 100644 (file)
@@ -3,7 +3,7 @@
 namespace CoreFramework\Feature;
 
 // Import framework stuff
 namespace CoreFramework\Feature;
 
 // Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Loader\NoClassException;
 use CoreFramework\Object\BaseFrameworkSystem;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Loader\NoClassException;
 use CoreFramework\Object\BaseFrameworkSystem;
@@ -80,7 +80,7 @@ class FrameworkFeature extends BaseFrameworkSystem {
                        $configKey = sprintf('enable_feature_%s', $featureName);
 
                        // Check configuration
                        $configKey = sprintf('enable_feature_%s', $featureName);
 
                        // Check configuration
-                       self::$enabledFeatures[$featureName]['is_enabled'] = (FrameworkConfiguration::getSelfInstance()->getConfigEntry($configKey) === 'Y');
+                       self::$enabledFeatures[$featureName]['is_enabled'] = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configKey) === 'Y');
                } // END - if
 
                // Return "cached" status
                } // END - if
 
                // Return "cached" status
index 6e775009ab3c94f6e41fdc3f8a339e00d55d511e..657c113742c318d73d86263a18e5e852a6947792 100644 (file)
@@ -3,7 +3,7 @@
 namespace CoreFramework\Localization;
 
 // Import framework stuff
 namespace CoreFramework\Localization;
 
 // Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Object\BaseFrameworkSystem;
 use CoreFramework\Registry\Registerable;
 use CoreFramework\Registry\Registry;
 use CoreFramework\Object\BaseFrameworkSystem;
 use CoreFramework\Registry\Registerable;
 use CoreFramework\Registry\Registry;
@@ -113,7 +113,7 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage,
                $langInstance->initLanguageStrings();
 
                // Set language code from default config
                $langInstance->initLanguageStrings();
 
                // Set language code from default config
-               $langInstance->setLanguageCode(FrameworkConfiguration::getSelfInstance()->getConfigEntry('default_lang'));
+               $langInstance->setLanguageCode(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('default_lang'));
 
                // Remember this instance
                self::$selfInstance = $langInstance;
 
                // Remember this instance
                self::$selfInstance = $langInstance;
index 52e6bc7f468793d7205cee75e16abc6ec1d3f364..f7dbd4bf9544823e96a55c4b3a69864220f4e4f6 100644 (file)
@@ -3,7 +3,7 @@
 namespace CoreFramework\Output;
 
 // Import framework stuff
 namespace CoreFramework\Output;
 
 // Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Generic\UnsupportedOperationException;
 use CoreFramework\Output\BaseOutput;
 use CoreFramework\Stream\Output\OutputStreamer;
 use CoreFramework\Generic\UnsupportedOperationException;
 use CoreFramework\Output\BaseOutput;
 use CoreFramework\Stream\Output\OutputStreamer;
@@ -81,7 +81,7 @@ class ConsoleOutput extends BaseOutput implements OutputStreamer {
        public static final function getInstance() {
                // Is the self-instance already set?
                if (is_null(self::$consoleInstance)) {
        public static final function getInstance() {
                // Is the self-instance already set?
                if (is_null(self::$consoleInstance)) {
-                       $contentType = FrameworkConfiguration::getSelfInstance()->getConfigEntry('web_content_type');
+                       $contentType = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('web_content_type');
                        self::$consoleInstance = ConsoleOutput::createConsoleOutput($contentType);
                } // END - if
 
                        self::$consoleInstance = ConsoleOutput::createConsoleOutput($contentType);
                } // END - if
 
index d730677cac1be44d8da8a50bb31d66f5daa58ff2..a5d50ba2a97d05365ad558d6f48bf71b4bd29a27 100644 (file)
@@ -3,7 +3,7 @@
 namespace CoreFramework\Console\Tools;
 
 // Import framework stuff
 namespace CoreFramework\Console\Tools;
 
 // Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Filesystem\FileNotFoundException;
 use CoreFramework\Generic\FrameworkException;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Filesystem\FileNotFoundException;
 use CoreFramework\Generic\FrameworkException;
@@ -55,7 +55,7 @@ class ConsoleTools extends BaseFrameworkSystem {
                parent::__construct(__CLASS__);
 
                // Cache configuration entry
                parent::__construct(__CLASS__);
 
                // Cache configuration entry
-               self::$quietResolver = FrameworkConfiguration::getSelfInstance()->getConfigEntry('quiet_dns_resolver');
+               self::$quietResolver = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('quiet_dns_resolver');
        }
 
        /**
        }
 
        /**
index c5ab7dd84aa667e4ab04a4e84428395338562344..6ac80114c620f1866619a5953e47d4288b08ac4f 100644 (file)
--- a/index.php
+++ b/index.php
@@ -4,7 +4,6 @@ namespace CoreFramework\EntryPoint;
 
 // Import framework stuff
 use CoreFramework\Bootstrap\FrameworkBootstrap;
 
 // Import framework stuff
 use CoreFramework\Bootstrap\FrameworkBootstrap;
-use CoreFramework\Configuration\FrameworkConfiguration;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Filesystem\FileNotFoundException;
 use CoreFramework\Helper\Application\ApplicationHelper;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Filesystem\FileNotFoundException;
 use CoreFramework\Helper\Application\ApplicationHelper;
@@ -75,7 +74,7 @@ final class ApplicationEntryPoint {
                } // END - if
 
                // Get config instance
                } // END - if
 
                // Get config instance
-               $configInstance = FrameworkConfiguration::getSelfInstance();
+               $configInstance = FrameworkBootstrap::getConfigurationInstance();
 
                // Do we have debug installation?
                if (($configInstance->getConfigEntry('product_install_mode') == 'productive') || ($silentMode === true)) {
 
                // Do we have debug installation?
                if (($configInstance->getConfigEntry('product_install_mode') == 'productive') || ($silentMode === true)) {
index de3ab8eeba73c84fa931fe443b9f9dfdb051ace6..7b102e0fed7b78c9d43039f731ea724b4cfdcef1 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 <?php
-
 // Import needed stuff
 // Import needed stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 
 /*
  * Copyright (C) 2017 Roland Haeder<roland@mxchange.org>
 
 /*
  * Copyright (C) 2017 Roland Haeder<roland@mxchange.org>
@@ -45,4 +44,4 @@ if (extension_loaded('xdebug')) {
 require dirname(__DIR__) . '/vendor/autoload.php';
 
 // Quiet DNS resolver as this is not wanted here
 require dirname(__DIR__) . '/vendor/autoload.php';
 
 // Quiet DNS resolver as this is not wanted here
-FrameworkConfiguration::getSelfInstance()->setConfigEntry('quiet_dns_resolver', TRUE);
+FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('quiet_dns_resolver', TRUE);
index 4de7bbccd70c528dbdbb0f982c1cb0c78e83620b..42040b706dc7e6f846995ef30ca4d82fdf868526 100644 (file)
@@ -1,9 +1,10 @@
 <?php
 <?php
-
 // Same namespace as target class
 namespace CoreFramework\Configuration;
 
 // Inport framework stuff
 // Same namespace as target class
 namespace CoreFramework\Configuration;
 
 // Inport framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
+use CoreFramework\Configuration\FrameworkConfiguration;
 use CoreFramework\Loader\ClassLoader;
 use CoreFramework\Generic\NullPointerException;
 use CoreFramework\Generic\UnsupportedOperationException;
 use CoreFramework\Loader\ClassLoader;
 use CoreFramework\Generic\NullPointerException;
 use CoreFramework\Generic\UnsupportedOperationException;
@@ -64,7 +65,7 @@ class FrameworkConfigurationTest extends TestCase {
                parent::setUpBeforeClass();
 
                // Init instance
                parent::setUpBeforeClass();
 
                // Init instance
-               self::$configInstance = FrameworkConfiguration::getSelfInstance();
+               self::$configInstance = FrameworkBootstrap::getConfigurationInstance();
 
                /*
                 * Disable strict naming-convention check in own class loader, because
 
                /*
                 * Disable strict naming-convention check in own class loader, because
@@ -92,7 +93,7 @@ class FrameworkConfigurationTest extends TestCase {
         */
        public function testGettingSelfConfigInstance () {
                // Get instance
         */
        public function testGettingSelfConfigInstance () {
                // Get instance
-               $dummyInstance = FrameworkConfiguration::getSelfInstance();
+               $dummyInstance = FrameworkBootstrap::getConfigurationInstance();
 
                // Should be equal to own instance
                $this->assertEquals(self::$configInstance, $dummyInstance);
 
                // Should be equal to own instance
                $this->assertEquals(self::$configInstance, $dummyInstance);
@@ -103,7 +104,7 @@ class FrameworkConfigurationTest extends TestCase {
         */
        public function testEqualsConfigInstance () {
                // Get instance
         */
        public function testEqualsConfigInstance () {
                // Get instance
-               $dummyInstance = FrameworkConfiguration::getSelfInstance();
+               $dummyInstance = new FrameworkConfiguration();
 
                // Should return TRUE
                $this->assertTrue(self::$configInstance->equals($dummyInstance));
 
                // Should return TRUE
                $this->assertTrue(self::$configInstance->equals($dummyInstance));
@@ -114,7 +115,7 @@ class FrameworkConfigurationTest extends TestCase {
         */
        public function testHashCodeConfigInstance () {
                // Get instance
         */
        public function testHashCodeConfigInstance () {
                // Get instance
-               $dummyInstance = FrameworkConfiguration::getSelfInstance();
+               $dummyInstance = FrameworkBootstrap::getConfigurationInstance();
 
                // Get hash code from both
                $hashCodeExpected = self::$configInstance->hashCode();
 
                // Get hash code from both
                $hashCodeExpected = self::$configInstance->hashCode();
@@ -152,7 +153,7 @@ class FrameworkConfigurationTest extends TestCase {
         */
        public function testSameConfigurationArrayGetter () {
                // Get instance
         */
        public function testSameConfigurationArrayGetter () {
                // Get instance
-               $dummyInstance = FrameworkConfiguration::getSelfInstance();
+               $dummyInstance = FrameworkBootstrap::getConfigurationInstance();
 
                // Get it from both instances
                $config1 = self::$configInstance->getConfigurationArray();
 
                // Get it from both instances
                $config1 = self::$configInstance->getConfigurationArray();