0) { $_CONFIG[$configEntry] += $value; } else { $_CONFIG[$configEntry] = $value; } } // Checks wether the configuration array is set so the config is loaded function isConfigLoaded () { global $_CONFIG; // Check all return ((isset($_CONFIG)) && (is_array($_CONFIG)) && (count($_CONFIG) > 0)); } // Init the config array function initConfig () { global $_CONFIG; debug_report_bug('Reached!'); // Set a minimum dummy configuration $_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 if ((isset($GLOBALS['cache_array'])) && (is_array($GLOBALS['cache_array'])) && (isset($GLOBALS['cache_array']['config'][$no])) && (is_array($GLOBALS['cache_array']['config'][$no]))) { // Load config from cache //* DEBUG: */ echo gettype($GLOBALS['cache_array']['config'][$no])."
\n"; foreach ($GLOBALS['cache_array']['config'][$no] as $key => $value) { setConfigEntry($key, $value); } // END - foreach // Count cache hits if exists if ((isConfigEntrySet('cache_hits')) && (EXT_IS_ACTIVE('cache'))) { incrementConfigEntry('cache_hits'); } // END - if } elseif ((!EXT_IS_ACTIVE('cache')) || (!isset($GLOBALS['cache_array']['config'][$no]))) { // Load config from DB $result_config = SQL_QUERY_ESC("SELECT * FROM `{!_MYSQL_PREFIX!}_config` WHERE config=%d LIMIT 1", array(bigintval($no)), __FUNCTION__, __LINE__); // Is the config there? if (SQL_NUMROWS($result_config) == 1) { // Get config from database mergeConfig(SQL_FETCHARRAY($result_config)); } // END - if // Free result SQL_FREERESULT($result_config); // Remember this config in the array $GLOBALS['cache_array']['config'][$no] = getConfigArray(); } } // Getter for whole $_CONFIG array function getConfigArray () { global $_CONFIG; // Default is null $return = null; // Is the config set? if (isConfigLoaded()) { // Then use it $return = $_CONFIG; } // END - if // Return result return $return; } // [EOF] ?>