X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Floader%2Fload_cache-modreg.php;h=4b5624dec1c5bd168adf0551085833da1abf00d9;hb=95f8e1b087e886f64a2fdd4a2af57e0be4e90d4a;hp=ed6797493d6bd3e873241e504632ee60c31e7ca8;hpb=dbe56bb043ba16ca1ec1e9efa9effdc1f0612261;p=mailer.git diff --git a/inc/loader/load_cache-modreg.php b/inc/loader/load_cache-modreg.php index ed6797493d..4b5624dec1 100644 --- a/inc/loader/load_cache-modreg.php +++ b/inc/loader/load_cache-modreg.php @@ -37,11 +37,14 @@ if (!defined('__SECURITY')) { require($INC); } +// Make cacheInstance global +global $cacheInstance; + // Next cached table is the module registry (mod_reg)... -if ($cacheInstance->cache_file("mod_reg", true) == true) { +if (($cacheInstance->loadCacheFile("mod_reg")) && ($cacheInstance->extensionVersionMatches("sql_patches"))) { // Load cache global $cacheArray; - $cacheArray['modules'] = $cacheInstance->cache_load(); + $cacheArray['modules'] = $cacheInstance->getArrayFromCache(); // Rewrite module cache $modArray = $cacheArray['modules']; @@ -64,9 +67,10 @@ if ($cacheInstance->cache_file("mod_reg", true) == true) { } // END - if } // END - foreach unset($modArray); -} elseif (($_CONFIG['cache_modreg'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { +} elseif ((getConfig('cache_modreg') == "Y") && ($CSS != "1") && ($CSS != "-1")) { // Create cache file here - $cacheInstance->cache_init("MODULES"); + $cacheInstance->init("MODULES"); + $cacheInstance->storeExtensionVersion("sql_patches"); // Load all modules and their data if (GET_EXT_VERSION("sql_patches") >= "0.3.6") { @@ -82,21 +86,18 @@ FROM "._MYSQL_PREFIX."_mod_reg ORDER BY id", __FILE__, __LINE__); // Cache all data while ($data = SQL_FETCHARRAY($result)) { // Add row to cache file - $cacheInstance->add_row($data); + $cacheInstance->addRow($data); } // END - while // Free memory SQL_FREERESULT($result); // Close the cache - $cacheInstance->cache_close(); + $cacheInstance->finalize(); // Reload the cache require(__FILE__); } -// Close file -$cacheInstance->cache_close(); - // ?>