*/
public final function entryPoint () {
// Handle the request
+ $this->handleRequest();
// Prepare the template engine
$tplEngine = $this->prepareTemplateEngine($this);
// CFG: VERBOSE-LEVEL
$cfg->setConfigEntry("verbose_level", 0);
-// Shall we include config-local.php where you can configure some things? Then
-// We need to do some things:
-//
-// First generate FQFN
-$localConfig = sprintf("%sinc/config-local%s", PATH, $cfg->readConfig("php_extension"));
-
-// Second is the file there and readable?
-if ((file_exists($localConfig)) && (is_readable($localConfig))) {
- // The third step to load it
- require_once($localConfig);
-}
-
// [EOF]
?>
* @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software
* @license GNU GPL 3.0 or any newer version
* @link http://www.mxchange.org
- *
+ *
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class FrameworkConfiguration {
- /**
- * Include files which shall be included before the main loader.
- */
- private $moreIncPre = null;
-
- /**
- * Include files which shall be included after the main loader.
- */
- private $moreIncPost = null;
-
/**
* The framework's main configuration array which will be initialized with
* hard-coded configuration data and might be overwritten/extended by
* Private constructor
*/
private function __construct () {
- // Initialize both include lists
- $this->moreIncPre = new ArrayObject();
- $this->moreIncPost = new ArrayObject();
+ // Empty for now
}
/**
}
}
- /**
- * Load all includes before main loader and clears the array after usage
- *
- * @return void
- */
- public function loadPreIncludes () {
- $this->loadIncludes($this->moreIncPre);
- unset($this->moreIncPre);
- }
-
- /**
- * Load all includes after main loader and clears the array after usage
- *
- * @return void
- */
- public function loadPostIncludes () {
- $this->loadIncludes($this->moreIncPost);
- unset($this->moreIncPost);
- }
-
/**
* Define the database type which must be valid and will not be verified.
*
ClassLoader::getInstance()->loadClasses("devel");
}
-/**
- * Load additional include files before main load
- */
-FrameworkConfiguration::getInstance()->loadPreIncludes();
-
-/**
- * Load all main include files
- *
- * +++ MAIN LOADER! +++
- *
- */
-
-///////////////////////////////////////////////////
-// Maybe we need this place for future releases? //
-///////////////////////////////////////////////////
-
-/**
- * Load additional include files after main load
- */
-FrameworkConfiguration::getInstance()->loadPostIncludes();
+// Shall we include additional configs where you can configure some things? Then
+// Load matching config
+ClassLoader::getInstance()->loadExtraConfigs();
// [EOF]
?>
//* DEBUG: */ print "Suffix=".$this->suffix."(".substr($dirClass2, -$this->sufLen, $this->sufLen).")\n";
//* DEBUG: */ print "ENTRY={$dirClass}\n";
if (
- (is_file($dirClass))
+ (is_file($dirClass))
&& (is_readable($dirClass))
&& (substr($dirClass2, 0 , $this->preLen) == $this->prefix)
&& (substr($dirClass2, -$this->sufLen, $this->sufLen) == $this->suffix)
$this->classes = new ArrayObject();
}
}
+
+ /**
+ * Load extra config files
+ *
+ * @return void
+ */
+ public function loadExtraConfigs () {
+ // Backup old prefix
+ $oldPrefix = $this->prefix;
+
+ // Set new prefix (temporary!)
+ $this->prefix = "config-";
+
+ // Set base directory
+ $basePath = sprintf("%s/inc/config/", PATH);
+
+ // Load all classes from the config directory
+ $this->loadClasses($basePath);
+
+ // Set the prefix back
+ $this->prefix = $oldPrefix;
+ }
}
// Initial load of core classes and the FrameworkDirectoryPointer class