https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114226
Revision: 114226
Author: jeroendedauw
Date: 2012-03-20 00:31:10 +0000 (Tue, 20 Mar 2012)
Log Message:
-----------
added enabled field so you can disable the cache thing if you need to before
its been initialized and fixed copypaste error
Modified Paths:
--------------
trunk/phase3/includes/actions/CachedAction.php
trunk/phase3/includes/specials/SpecialCachedPage.php
Modified: trunk/phase3/includes/actions/CachedAction.php
===================================================================
--- trunk/phase3/includes/actions/CachedAction.php 2012-03-20 00:30:39 UTC
(rev 114225)
+++ trunk/phase3/includes/actions/CachedAction.php 2012-03-20 00:31:10 UTC
(rev 114226)
@@ -37,6 +37,14 @@
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.
*
* @since 1.20
@@ -56,8 +64,9 @@
* @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();
Modified: trunk/phase3/includes/specials/SpecialCachedPage.php
===================================================================
--- trunk/phase3/includes/specials/SpecialCachedPage.php 2012-03-20
00:30:39 UTC (rev 114225)
+++ trunk/phase3/includes/specials/SpecialCachedPage.php 2012-03-20
00:31:10 UTC (rev 114226)
@@ -37,6 +37,14 @@
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.
*
* @since 1.20
@@ -56,8 +64,9 @@
* @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();
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs