]> git.mxchange.org Git - mailer.git/blobdiff - inc/loader/load_cache-modreg.php
Final fixes for 'loading cache vs. filters vs. extensions' construct
[mailer.git] / inc / loader / load_cache-modreg.php
index ed6797493d6bd3e873241e504632ee60c31e7ca8..4b5624dec1c5bd168adf0551085833da1abf00d9 100644 (file)
@@ -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();
-
 //
 ?>