openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit b241273055b08254032ae1a0751bcab7f80c45a0
parent e56ab29ddbdaa8387b1ca9177a9d103e8a94fc50
Author: Jan Dankert <devnull@localhost>
Date:   Mon, 12 Mar 2012 23:17:43 +0100

Konfigurationen pro virtuellem Host ablegen...

Diffstat:
config/config.ini.php | 7+++++++
dispatcher.php | 12++++++++----
init.php | 2+-
3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/config/config.ini.php b/config/config.ini.php @@ -0,0 +1,6 @@ +; <?php exit('direct access denied') ?> + + +per_host_configuration = true + +per_host_configuration_dir = ./config/virtual+ \ No newline at end of file diff --git a/dispatcher.php b/dispatcher.php @@ -52,14 +52,18 @@ $conf = Session::getConfig(); // Wenn Konfiguration noch nicht in Session vorhanden, dann // aus Datei lesen. -if ( !is_array( $conf ) ) +if ( !is_array( $conf ) || @$REQ['reload']=='1' ) { // Da die Konfiguration neu eingelesen wird, sollten wir auch die Sitzung komplett leeren. session_unset(); - $prefs = new Preferences(); - $conf = $prefs->load(); - $conf['action'] = $prefs->load(OR_ACTIONCLASSES_DIR); + $conf = Preferences::load(); + + if ( $conf['config']['per_host_configuration'] ) + if ( !empty($_SERVER['HTTP_HOST'])) + $conf = Preferences::load($conf['config']['per_host_configuration_dir'].'/'.$_SERVER['HTTP_HOST'].'/'); + + $conf['action'] = Preferences::load(OR_ACTIONCLASSES_DIR); $conf['build'] = parse_ini_file('build.ini'); // Sprache lesen und zur Konfiguration hinzufuegen diff --git a/init.php b/init.php @@ -45,7 +45,7 @@ define('OR_CONFIG_DIR' ,OR_PREFERENCES_DIR ); define('OR_THEMES_DIR' ,'./themes/' ); define('OR_THEMES_EXT_DIR' ,defined('OR_BASE_URL')?slashify(OR_BASE_URL).'themes/':OR_THEMES_DIR); define('OR_TMP_DIR' ,'./tmp/' ); -define('OR_CONTROLLER_FILE' ,defined('OR_EXT_CONTROLLER_FILE')?OR_EXT_CONTROLLER_FILE:'do'); +define('OR_CONTROLLER_FILE' ,defined('OR_EXT_CONTROLLER_FILE')?OR_EXT_CONTROLLER_FILE:'dispatcher'); define('START_TIME' ,time() );