added enabled field so you can disable the cache thing if you need to before its...
authorJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Tue, 20 Mar 2012 00:31:10 +0000 (00:31 +0000)
committerJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Tue, 20 Mar 2012 00:31:10 +0000 (00:31 +0000)
includes/actions/CachedAction.php
includes/specials/SpecialCachedPage.php

index 5a2264a..300a93d 100644 (file)
@@ -36,6 +36,14 @@ abstract class CachedAction extends FormlessAction implements ICacheHelper {
         */
        protected $cacheHelper;
 
+       /**
+        * If the cache is enabled or not.
+        *
+        * @since 1.20
+        * @var boolean
+        */
+       protected $cacheEnabled = true;
+
        /**
         * Sets if the cache should be enabled or not.
         *
@@ -56,8 +64,9 @@ abstract class CachedAction extends FormlessAction implements ICacheHelper {
         * @param boolean|null $cacheEnabled Sets if the cache should be enabled or not.
         */
        public function startCache( $cacheExpiry = null, $cacheEnabled = null ) {
-               $this->cacheHelper = new CacheHelper( $this->get );
+               $this->cacheHelper = new CacheHelper();
 
+               $this->cacheHelper->setCacheEnabled( $this->cacheEnabled );
                $this->cacheHelper->setOnInitializedHandler( array( $this, 'onCacheInitialized' ) );
 
                $keyArgs = $this->getCacheKey();
index eb8e6b9..6c48434 100644 (file)
@@ -36,6 +36,14 @@ abstract class SpecialCachedPage extends SpecialPage implements ICacheHelper {
         */
        protected $cacheHelper;
 
+       /**
+        * If the cache is enabled or not.
+        *
+        * @since 1.20
+        * @var boolean
+        */
+       protected $cacheEnabled = true;
+
        /**
         * Sets if the cache should be enabled or not.
         *
@@ -56,8 +64,9 @@ abstract class SpecialCachedPage extends SpecialPage implements ICacheHelper {
         * @param boolean|null $cacheEnabled Sets if the cache should be enabled or not.
         */
        public function startCache( $cacheExpiry = null, $cacheEnabled = null ) {
-               $this->cacheHelper = new CacheHelper( $this->get );
+               $this->cacheHelper = new CacheHelper();
 
+               $this->cacheHelper->setCacheEnabled( $this->cacheEnabled );
                $this->cacheHelper->setOnInitializedHandler( array( $this, 'onCacheInitialized' ) );
 
                $keyArgs = $this->getCacheKey();