X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=framework%2Fconfig%2Fclass_FrameworkConfiguration.php;h=0826076e41a5f1b077ad3fbf62e41ac07a8cd46f;hp=82d50bf964606d4882a619806f11fa96178122fc;hb=24814f48bc7bad92f55e8763bf3f657fb41b131d;hpb=974964e500f24aa7695dc4ec555dc659f78e40e8 diff --git a/framework/config/class_FrameworkConfiguration.php b/framework/config/class_FrameworkConfiguration.php index 82d50bf9..0826076e 100644 --- a/framework/config/class_FrameworkConfiguration.php +++ b/framework/config/class_FrameworkConfiguration.php @@ -48,12 +48,7 @@ class FrameworkConfiguration implements Registerable { * 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) @@ -66,11 +61,12 @@ class FrameworkConfiguration implements Registerable { const EXCEPTION_CONFIG_VALUE_TYPE_UNSUPPORTED = 0x132; /** - * Private constructor + * Default constructor, the configuration entries are static, not the + * whole instance. * * @return void */ - private function __construct () { + public function __construct () { // Empty for now } @@ -83,22 +79,6 @@ class FrameworkConfiguration implements Registerable { 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 * @@ -121,7 +101,7 @@ class FrameworkConfiguration implements Registerable { } // 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; @@ -159,7 +139,7 @@ class FrameworkConfiguration implements Registerable { } // 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); - $this->config[$configKey] = $configValue; + self::$config[$configKey] = $configValue; // Resort the array - ksort($this->config); + ksort(self::$config); } /** @@ -206,7 +186,7 @@ class FrameworkConfiguration implements Registerable { */ public final function getConfigurationArray () { // Return it - return $this->config; + return self::$config; } /** @@ -242,7 +222,7 @@ class FrameworkConfiguration implements Registerable { } // END - if // Unset it - unset($this->config[$configKey]); + unset(self::$config[$configKey]); } /**