include_once(PATH."inc/libs/cache_functions.php");
$cacheMode = "";
include_once(PATH."inc/extensions/ext-cache.php");
- switch($cacheInstance->cache_file("extensions", true)) {
+ switch (($cacheInstance->cache_file("extensions", true)) && ($cacheInstance->ext_version_matches("sql_patches"))) {
case true : $cacheMode = "load"; break;
case false: $cacheMode = "init"; break;
}
if ($cacheMode == "init") {
// Init cache file
$cacheInstance->cache_init("EXTENSIONS");
+ $cacheInstance->store_extension_version("sql_patches");
if ($_CONFIG['cache_exts'] == "N") $cacheMode = "skip";
} // END - if
// Load extension data from cache file
$EXT_DUMMY = $cacheInstance->cache_load();
+ // Is the cache file fine?
+ if (!isset($EXT_DUMMY['ext_name'])) {
+ // Cache file is damaged so kill it
+ $cacheInstance->cache_destroy();
+
+ // Skip any further execution
+ return;
+ } // END - if
+
// Begin with the cache preparation of extensions
$EXT_NAMES = array();
foreach ($EXT_DUMMY['ext_name'] as $k => $name) {
if (FILE_READABLE($INC)) {
// Add it
$EXT_POOL[] = $INC;
- }
+ } // END - if
} // END - if
// Load CSS file
// Version number
$EXT_DUMMY['ext_version'][$name] = $EXT_DUMMY['ext_version'][$k];
unset($EXT_DUMMY['ext_version'][$k]);
+
// Extension is active
$EXT_DUMMY['ext_active'][$name] = $EXT_DUMMY['ext_active'][$k];
unset($EXT_DUMMY['ext_active'][$k]);
+
// Ext menu
$EXT_DUMMY['ext_menu'][$name] = $EXT_DUMMY['ext_menu'][$k];
unset($EXT_DUMMY['ext_menu'][$k]);
+
// Extension id
$EXT_DUMMY['ext_id'][$name] = $EXT_DUMMY['ext_id'][$k];
$id = $EXT_DUMMY['ext_id'][$name];
// Free memory
SQL_FREERESULT($res_ext_crt);
-}
+} // END - if
// Load include files if found
if (!empty($INC_POOL[0])) {