require($INC);
}
-// Merges $GLOBALS['config'] with data in given array
-function mergeConfig ($newConfig) {
- $GLOBALS['config'] = merge_array(getConfigArray(), $newConfig);
+// Init the config array
+function initConfig () {
+ // Init not if already found
+ if ((isset($GLOBALS['config'])) && (count($GLOBALS['config']) >= 3)) {
+ // Already initialized
+ trigger_error(sprintf("[%s:%s] Configuration is already initialized.", __FUNCTION__, __LINE__));
+ } // END - if
+
+ // Set a minimum dummy configuration
+ $GLOBALS['config'] = array(
+ 'code_length' => 0,
+ 'patch_level' => 0,
+ 'last_update' => time(),
+ 'DEBUG_MODE' => 'N',
+ 'DEBUG_RESET' => 'N',
+ 'DEBUG_MONTHLY' => 'N',
+ 'DEBUG_WEEKLY' => 'N',
+ 'DEBUG_REGEX' => 'N',
+ 'sql_count' => 0,
+ 'num_templates' => 0,
+ 'default_theme' => 'default',
+ );
}
// Getter for $GLOBALS['config'] entries
$value = null;
// Is the entry there?
- if (isConfigEntrySet($configEntry)) {
- // Then use it
- $value = $GLOBALS['config'][$configEntry];
+ if (!isConfigEntrySet($configEntry)) {
+ // Raise an error of missing entries
+ trigger_error(sprintf("[%s:%s] Configuration entry <em>%s</em> is missing.", __FUNCTION__, __LINE__, $configEntry));
} // END - if
// Return it
- return $value;
+ return $GLOBALS['config'][$configEntry];
}
// Setter for $GLOBALS['config'] entries
return (isset($GLOBALS['config'][$configEntry]));
}
+// Merges $GLOBALS['config'] with data in given array
+function mergeConfig ($newConfig) {
+ $GLOBALS['config'] = merge_array(getConfigArray(), $newConfig);
+}
+
// Increment or init with given value or 1 as default the given config entry
function incrementConfigEntry ($configEntry, $value=1) {
// Increment it if set or init it with 1
return ((isset($GLOBALS['config'])) && (is_array($GLOBALS['config'])) && (count($GLOBALS['config']) > 0));
}
-// Init the config array
-function initConfig () {
- // Set a minimum dummy configuration
- $GLOBALS['config'] = array(
- 'code_length' => 0,
- 'patch_level' => 0,
- 'last_update' => time()
- );
-}
-
// Load configuration and return it as an arry
function loadConfiguration ($no = '0') {
// Check for cache extension, cache-array and if the requested configuration is in cache