From f8121585ae97890245b1969cb62fbef583462b7d Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Thu, 22 Jan 2009 12:44:57 +0100 Subject: further updates to config_cascade patch - add mediameta and license config files into the cascade - update the cache validity code in cache.php, css.php & js.php to use config_cascade - redo inclusion of main config files to avoid suppression of errors in config files - add getConfigFiles($type) function - minor updates elsewhere to use config_cascade rather than hardcoded config file names darcs-hash:20090122114457-f07c6-98ad5627fd5df93edf8dd03289b9cf6d81962afe.gz --- inc/init.php | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'inc/init.php') diff --git a/inc/init.php b/inc/init.php index 3df769ce8..1d651812f 100644 --- a/inc/init.php +++ b/inc/init.php @@ -62,6 +62,14 @@ 'default' => array(DOKU_CONF.'interwiki.conf'), 'local' => array(DOKU_CONF.'interwiki.local.conf'), ), + 'license' => array( + 'default' => array(DOKU_CONF.'license.php'), + 'local' => array(DOKU_CONF.'license.local.php'), + ), + 'mediameta' => array( + 'default' => array(DOKU_CONF.'mediameta.php'), + 'local' => array(DOKU_CONF.'mediameta.local.php'), + ), 'mime' => array( 'default' => array(DOKU_CONF.'mime.conf'), 'local' => array(DOKU_CONF.'mime.local.conf'), @@ -87,8 +95,11 @@ // load the global config file(s) foreach (array('default','local','protected') as $config_group) { + if (empty($config_cascade['main'][$config_group])) continue; foreach ($config_cascade['main'][$config_group] as $config_file) { - @include($config_file); + if (@file_exists($config_file)) { + include($config_file); + } } } @@ -107,9 +118,13 @@ $license = array(); // load the license file(s) - require_once(DOKU_CONF.'license.php'); - if(@file_exists(DOKU_CONF.'license.php')){ - require_once(DOKU_CONF.'license.php'); + foreach (array('default','local') as $config_group) { + if (empty($config_cascade['license'][$config_group])) continue; + foreach ($config_cascade['license'][$config_group] as $config_file) { + if(@file_exists($config_file)){ + include($config_file); + } + } } // define baseURL -- cgit v1.2.3