Registry::isInitialized('OK');
} elseif ($this->__toString() == 'DebugMiddleware') {
// Set configuration instance
- $this->setConfigInstance(FrameworkConfiguration::createFrameworkConfiguration());
+ $this->setConfigInstance(FrameworkConfiguration::getInstance());
}
}
@require_once(dirname(__FILE__) . '/config/class_FrameworkConfiguration.php');
// Get a new configuration instance
-$cfg = FrameworkConfiguration::createFrameworkConfiguration();
+$cfg = FrameworkConfiguration::getInstance();
// CFG: SERVER-PATH
$cfg->setConfigEntry('base_path', (dirname(dirname(__FILE__)) . '/')); // DON'T MISS THE TRAILING SLASH!!!
// Empty for now
}
- /**
- * "Create" a configuration instance
- *
- * @param $enableDebug Wether enable debug mode (default: off)
- * @return $cfgInstance An instance of this configuration class
- */
- public final static function createFrameworkConfiguration ($enableDebug = false) {
- /**
- * For singleton design pattern because we only need a one-time-run
- * through the initial configuration.
- */
- if (is_null(self::$cfgInstance)) {
- // CFG: ERROR-REPORTING
- @error_reporting(E_ALL | E_STRICT);
-
- /**
- * Shall we enable the debug mode?
- */
- if ($enableDebug) {
- define('DEBUG_MODE', true);
- }
-
- /**
- * Crate a config instance
- */
- self::$cfgInstance = new FrameworkConfiguration();
- }
-
- /**
- * Return the instance
- */
- return self::$cfgInstance;
- }
-
/**
* Getter for an instance of this class
*
* @return $cfgInstance An instance of this class
*/
public final static function getInstance () {
+ // is the instance there?
+ if (is_null(self::$cfgInstance)) {
+ // Create a config instance
+ self::$cfgInstance = new FrameworkConfiguration();
+ } // END - if
+
return self::$cfgInstance;
}