X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fload_extensions.php;h=87f1179fb1e3d431d2e58342842f350b4c80184b;hp=e7d7e0b9003cff8fa6f04f65c7041bcee1d1e2db;hb=f13b0c89b6dce2dc31ef3c58f0e2ad4821d7bee8;hpb=3c4fbc22e3c04348734182d4d29bfef7eb050aa6 diff --git a/inc/load_extensions.php b/inc/load_extensions.php index e7d7e0b900..87f1179fb1 100644 --- a/inc/load_extensions.php +++ b/inc/load_extensions.php @@ -64,7 +64,7 @@ if (EXT_IS_ACTIVE("cache")) { 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; } @@ -75,6 +75,7 @@ if (EXT_IS_ACTIVE("cache")) { 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 @@ -94,6 +95,15 @@ if ($cacheMode == "load") { // 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) { @@ -108,7 +118,7 @@ if ($cacheMode == "load") { if (FILE_READABLE($INC)) { // Add it $EXT_POOL[] = $INC; - } + } // END - if } // END - if // Load CSS file @@ -122,12 +132,15 @@ if ($cacheMode == "load") { // 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]; @@ -296,7 +309,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1") // Free memory SQL_FREERESULT($res_ext_crt); -} +} // END - if // Load include files if found if (!empty($INC_POOL[0])) {