summaryrefslogtreecommitdiff
path: root/inc/confutils.php
diff options
context:
space:
mode:
authorChris Smith <chris.eureka@jalakai.co.uk>2009-01-22 12:44:57 +0100
committerChris Smith <chris.eureka@jalakai.co.uk>2009-01-22 12:44:57 +0100
commitf8121585ae97890245b1969cb62fbef583462b7d (patch)
tree15936160cdbb9a2e22fd9ac53ecfd682c5f22e81 /inc/confutils.php
parentf0a201c5703333fa2b120cda8e145fb405283908 (diff)
downloadrpg-f8121585ae97890245b1969cb62fbef583462b7d.tar.gz
rpg-f8121585ae97890245b1969cb62fbef583462b7d.tar.bz2
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
Diffstat (limited to 'inc/confutils.php')
-rw-r--r--inc/confutils.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/inc/confutils.php b/inc/confutils.php
index 2099ba949..53db69565 100644
--- a/inc/confutils.php
+++ b/inc/confutils.php
@@ -182,6 +182,27 @@ function retrieveConfig($type,$fn) {
}
/**
+ * Include the requested configuration information
+ *
+ * @author Chris Smith <chris@jalakai.co.uk>
+ *
+ * @param string $type the configuration settings to be read, must correspond to a key/array in $config_cascade
+ * @return array list of files, default before local before protected
+ */
+function getConfigFiles($type) {
+ global $config_cascade;
+ $files = array();
+
+ if (!is_array($config_cascade[$type])) trigger_error('Missing config cascade for "'.$type.'"',E_USER_WARNING);
+ foreach (array('default','local','protected') as $config_group) {
+ if (empty($config_cascade[$type][$config_group])) continue;
+ $files = array_merge($files, $config_cascade[$type][$config_group]);
+ }
+
+ return $files;
+}
+
+/**
* check if the given action was disabled in config
*
* @author Andreas Gohr <andi@splitbrain.org>