X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Fcache_functions.php;h=8ef45755e83065b164b2d75320bec6a415c0c957;hp=bc24b68aaec6f30ac425e79bd8679c6ee701de95;hb=2b388c21a07e07317ccb065d42ef7304cfca7718;hpb=b7aada7890a3c7d1c1da4d2b36d8d7683fa61c06 diff --git a/inc/libs/cache_functions.php b/inc/libs/cache_functions.php index bc24b68aae..8ef45755e8 100644 --- a/inc/libs/cache_functions.php +++ b/inc/libs/cache_functions.php @@ -10,7 +10,12 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Funktionen fuer die admins-Erweiterung * * -------------------------------------------------------------------- * - * * + * $Revision:: 856 $ * + * $Date:: $ * + * $Tag:: 0.2.1-FINAL $ * + * $Author:: $ * + * Needs to be in all Files and every File needs "svn propset * + * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2008 by Roland Haeder * * For more information visit: http://www.mxchange.org * @@ -59,7 +64,7 @@ class CacheSystem { $this->path = $path; // Check if path exists - if ((is_dir($path)) && (!$tested)) { + if ((isDirectory($path)) && (!$tested)) { // Check if we can create a file inside the path touch($path."dummy.tmp", 'w'); if (FILE_READABLE($path."dummy.tmp")) { @@ -89,7 +94,7 @@ class CacheSystem { // Remember cache file $this->name = $cacheName; - // COnstruct include filename for LOAD_INC_ONCE() call + // Construct include filename for LOAD_INC_ONCE() call $this->inc = $this->path . $cacheName . ".cache"; // Construct FQFN (full qualified file name) @@ -223,6 +228,7 @@ class CacheSystem { // Remove cache file from system //* DEBUG: */ print __METHOD__."(".__LINE__."): {$this->name} - DESTROYED!
\n"; unlink($this->fqfn); + // @TODO remove from $GLOBALS['cache_array']!!! // Is the file there? if (!$this->isCacheReadable()) { @@ -407,16 +413,15 @@ class CacheSystem { function isCacheReadable () { return INCLUDE_READABLE($this->inc); } + } // END - class // Destroy the cache on extension changes function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) { // Remove cache - if (EXT_IS_ACTIVE("cache")) { - 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("modreg")) $GLOBALS['cache_instance']->destroyCacheFile(); - } // END - if + 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("modreg")) $GLOBALS['cache_instance']->destroyCacheFile(); // Return it return $data; @@ -425,24 +430,21 @@ function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) { // Destroy the cache on changing admin function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE () { // Remove cache - if (EXT_IS_ACTIVE("cache")) { - if ($GLOBALS['cache_instance']->loadCacheFile("admins")) $GLOBALS['cache_instance']->destroyCacheFile(); - } // END - if + if ($GLOBALS['cache_instance']->loadCacheFile("admins")) $GLOBALS['cache_instance']->destroyCacheFile(); } // Destroy all cache files function FILTER_CACHE_DESTROY_ALL () { - // Remove cache - if (EXT_IS_ACTIVE("cache")) { - 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("modreg")) $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 + // Remove cache files + 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("modreg")) $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(); + if ($GLOBALS['cache_instance']->loadCacheFile("revision")) $GLOBALS['cache_instance']->destroyCacheFile(); } // Filter for purging entire admin menu cache