[BUGFIX] Clean up API of t3lib_cache
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 22 Aug 2011 18:11:40 +0000 (20:11 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Mon, 22 Aug 2011 19:03:33 +0000 (21:03 +0200)
This cleans up some loose ends of the caching framework by default patch series
for 4.6: Some methods in t3lib_cache are not static and there is still a check
for isCachingFrameworkInitialized() in tcemain.

Change-Id: I5725672849db185eaa6683ee9749cc9295d4ef01
Resolves: #29171
Reviewed-on: http://review.typo3.org/4529
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
t3lib/class.t3lib_cache.php
t3lib/class.t3lib_tcemain.php

index 28841e0..ae5ab76 100644 (file)
@@ -25,7 +25,7 @@
 /**
  * A cache handling helper class
  *
- * @author     Ingo Renner <ingo@typo3.org>
+ * @author Ingo Renner <ingo@typo3.org>
  * @package TYPO3
  * @subpackage t3lib
  */
@@ -88,9 +88,9 @@ class t3lib_cache {
         * Determines whether the caching framework is initialized.
         * The caching framework could be disabled for the core but used by an extension.
         *
-        * @return      boolean
+        * @return boolean True if caching framework is initialized
         */
-       public function isCachingFrameworkInitialized() {
+       public static function isCachingFrameworkInitialized() {
                if (!self::$isCachingFrameworkInitialized
                                && isset($GLOBALS['typo3CacheManager']) && $GLOBALS['typo3CacheManager'] instanceof t3lib_cache_Manager
                                && isset($GLOBALS['typo3CacheFactory']) && $GLOBALS['typo3CacheFactory'] instanceof t3lib_cache_Factory
@@ -107,9 +107,9 @@ class t3lib_cache {
         * since rendering is already started using the defined caches.
         *
         * @deprecated since 4.6, will be removed in 4.8: The caching framework is enabled by default
-        * @return      void
+        * @return void
         */
-       public function enableCachingFramework() {
+       public static function enableCachingFramework() {
                t3lib_div::logDeprecatedFunction();
        }
 
@@ -121,7 +121,7 @@ class t3lib_cache {
         *
         * @return string Required table structure of all registered caches
         */
-       public function getDatabaseTableDefinitions() {
+       public static function getDatabaseTableDefinitions() {
                $tableDefinitions = '';
                foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] as $cacheName => $_) {
                        $backend = $GLOBALS['typo3CacheManager']->getCache($cacheName)->getBackend();
index c12b56b..2367eef 100644 (file)
@@ -6658,11 +6658,8 @@ class t3lib_TCEmain {
                        break;
                        case 'all':
                                if ($this->admin || $this->BE_USER->getTSConfigVal('options.clearCache.all')) {
-
                                                // Clear all caching framework caches
-                                       if (t3lib_cache::isCachingFrameworkInitialized()) {
-                                               $GLOBALS['typo3CacheManager']->flushCaches();
-                                       }
+                                       $GLOBALS['typo3CacheManager']->flushCaches();
 
                                        if (t3lib_extMgm::isLoaded('cms')) {
                                                $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('cache_treelist');
@@ -7090,4 +7087,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tcemain.php']);
 }
 
-?>
+?>
\ No newline at end of file