X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fcache_functions.php;h=2ba4bd0a353a9f7b8934e69d777eb2d37bbd90e3;hb=4dc056934bd8ff57cea020ffd64900223a20e3ba;hp=121cfc096a79f08c32c6f8b53d09b3ce1b426281;hpb=d52156d35605388b7554c31d08bc29f0bb167079;p=mailer.git diff --git a/inc/libs/cache_functions.php b/inc/libs/cache_functions.php index 121cfc096a..2ba4bd0a35 100644 --- a/inc/libs/cache_functions.php +++ b/inc/libs/cache_functions.php @@ -44,8 +44,8 @@ class CacheSystem { var $path = ""; var $inc = ""; var $pointer = false; - var $data = ""; - var $version = ""; + var $data = array(); + var $version = array(); var $name = ""; var $rebuilt = array(); @@ -117,20 +117,19 @@ class CacheSystem { } function addRow ($data) { - global $cacheArray; - + // Is the pointe rvalid? if (is_resource($this->pointer)) { // Write every array element to cache file foreach ($data as $k => $v) { // Write global cache array for immediate access if ((substr($k, 0, 4) == "ext_") && (isset($data['ext_name'])) && (isset($data['ext_id']))) { if ($k != "ext_name") { - $cacheArray['extensions'][$k][$data['ext_name']] = $v; + $GLOBALS['cache_array']['extensions'][$k][$data['ext_name']] = $v; } else { - $cacheArray['extensions'][$k][$data['ext_id']] = $v; + $GLOBALS['cache_array']['extensions'][$k][$data['ext_id']] = $v; } if (($k == "ext_keep") && ($v == "Y")) { - $cacheArray['active_extensions'][$data['ext_name']] = $v; + $GLOBALS['cache_array']['active_extensions'][$data['ext_name']] = $v; } // END - if } elseif (is_array($v)) { // Serialize and BASE64-encode the array @@ -395,13 +394,11 @@ class CacheSystem { // Destroy the cache on extension changes function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) { - global $cacheInstance; - // Remove cache if (EXT_IS_ACTIVE("cache")) { - if ($cacheInstance->loadCacheFile("config")) $cacheInstance->destroyCacheFile(); - if ($cacheInstance->loadCacheFile("extensions")) $cacheInstance->destroyCacheFile(); - if ($cacheInstance->loadCacheFile("mod_reg")) $cacheInstance->destroyCacheFile(); + if ($GLOBALS['cache_instance']->loadCacheFile("config")) $GLOBALS['cache_instance']->destroyCacheFile(); + if ($GLOBALS['cache_instance']->loadCacheFile("extensions")) $GLOBALS['cache_instance']->destroyCacheFile(); + if ($GLOBALS['cache_instance']->loadCacheFile("mod_reg")) $GLOBALS['cache_instance']->destroyCacheFile(); } // END - if // Return it @@ -410,28 +407,24 @@ function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) { // Destroy the cache on changing admin function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE () { - global $cacheInstance; - // Remove cache if (EXT_IS_ACTIVE("cache")) { - if ($cacheInstance->loadCacheFile("admins")) $cacheInstance->destroyCacheFile(); + if ($GLOBALS['cache_instance']->loadCacheFile("admins")) $GLOBALS['cache_instance']->destroyCacheFile(); } // END - if } // Destroy all cache files function FILTER_CACHE_DESTROY_ALL () { - global $cacheInstance; - // Remove cache if (EXT_IS_ACTIVE("cache")) { - if ($cacheInstance->loadCacheFile("admins")) $cacheInstance->destroyCacheFile(); - if ($cacheInstance->loadCacheFile("admins_acls")) $cacheInstance->destroyCacheFile(); - if ($cacheInstance->loadCacheFile("config")) $cacheInstance->destroyCacheFile(); - if ($cacheInstance->loadCacheFile("extensions")) $cacheInstance->destroyCacheFile(); - if ($cacheInstance->loadCacheFile("mod_reg")) $cacheInstance->destroyCacheFile(); - if ($cacheInstance->loadCacheFile("refdepths")) $cacheInstance->destroyCacheFile(); - if ($cacheInstance->loadCacheFile("refsystem")) $cacheInstance->destroyCacheFile(); - if ($cacheInstance->loadCacheFile("themes")) $cacheInstance->destroyCacheFile(); + if ($GLOBALS['cache_instance']->loadCacheFile("admins")) $GLOBALS['cache_instance']->destroyCacheFile(); + if ($GLOBALS['cache_instance']->loadCacheFile("admins_acls")) $GLOBALS['cache_instance']->destroyCacheFile(); + if ($GLOBALS['cache_instance']->loadCacheFile("config")) $GLOBALS['cache_instance']->destroyCacheFile(); + if ($GLOBALS['cache_instance']->loadCacheFile("extensions")) $GLOBALS['cache_instance']->destroyCacheFile(); + if ($GLOBALS['cache_instance']->loadCacheFile("mod_reg")) $GLOBALS['cache_instance']->destroyCacheFile(); + if ($GLOBALS['cache_instance']->loadCacheFile("refdepths")) $GLOBALS['cache_instance']->destroyCacheFile(); + if ($GLOBALS['cache_instance']->loadCacheFile("refsystem")) $GLOBALS['cache_instance']->destroyCacheFile(); + if ($GLOBALS['cache_instance']->loadCacheFile("themes")) $GLOBALS['cache_instance']->destroyCacheFile(); } // END - if }