From: Jeroen De Dauw Date: Tue, 20 Mar 2012 00:31:10 +0000 (+0000) Subject: added enabled field so you can disable the cache thing if you need to before its... X-Git-Tag: 1.31.0-rc.0~24184 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=c94d9162fcf544d94052654b414d0249861c9695;p=lhc%2Fweb%2Fwiklou.git added enabled field so you can disable the cache thing if you need to before its been initialized and fixed copypaste error --- diff --git a/includes/actions/CachedAction.php b/includes/actions/CachedAction.php index 5a2264a0cd..300a93ddf9 100644 --- a/includes/actions/CachedAction.php +++ b/includes/actions/CachedAction.php @@ -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(); diff --git a/includes/specials/SpecialCachedPage.php b/includes/specials/SpecialCachedPage.php index eb8e6b9d0c..6c484344f6 100644 --- a/includes/specials/SpecialCachedPage.php +++ b/includes/specials/SpecialCachedPage.php @@ -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();