Global variables rewritten
[mailer.git] / inc / extensions / ext-cache.php
index 897c3e370ce69272cd8d9d9ef756c4341cb730fb..5f7a2d412beaad44aca637f0ea3cecf0f74fcf0a 100644 (file)
@@ -106,7 +106,7 @@ case "update": // Update an extension
                // Is the cache extension itself there?
                if (EXT_IS_ACTIVE("cache")) {
                        // Check for cache when extension is already installed
-                       if ($cacheInstance->loadCacheFile("extensions", true)) $cacheInstance->destroyCacheFile();
+                       if ($GLOBALS['cache_instance']->loadCacheFile("extensions", true)) $GLOBALS['cache_instance']->destroyCacheFile();
                } // END - if
 
                // Update notes (these will be set as task text!)
@@ -243,13 +243,10 @@ case "test": // For testing purposes. For details see file inc/modules/admin/wha
 
 default: // Do stuff when extension is loaded
        // Create instance on class
-       if ($cacheMode != "init") {
-               // Make cacheInstance global
-               global $cacheInstance;
-
+       if ($GLOBALS['cacheMode'] != "init") {
                // Initialize cache system only when it's needed
-               $cacheInstance = new CacheSystem(getConfig('cache_update'), constant('PATH')."inc/".getConfig('cache_path'), getConfig('cache_tested'));
-               if ($cacheInstance->getStatus() != "done") {
+               $GLOBALS['cache_instance'] = new CacheSystem(getConfig('cache_update'), constant('PATH')."inc/".getConfig('cache_path'), getConfig('cache_tested'));
+               if ($GLOBALS['cache_instance']->getStatus() != "done") {
                        // Failed to initialize cache sustem
                        addFatalMessage(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_INITIALIZE);
                } // END - if