Deprecate $wgEnableParserCache
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 19 May 2015 21:47:33 +0000 (14:47 -0700)
committerTimo Tijhof <krinklemail@gmail.com>
Thu, 4 Jun 2015 18:23:03 +0000 (19:23 +0100)
* There is little reason to disable it and one can set $wgParserCacheType
  if truly needed

Change-Id: Iec5fc7729d0f9de67ec2aa6c0e9c2c1e3e0d57ad

RELEASE-NOTES-1.26
docs/memcached.txt
includes/DefaultSettings.php
includes/Setup.php
includes/page/WikiPage.php
tests/parser/parserTest.inc
tests/phpunit/includes/parser/NewParserTest.php
tests/phpunit/suites/UploadFromUrlTestSuite.php

index 6f1120e..95f68e1 100644 (file)
@@ -9,6 +9,8 @@ MediaWiki 1.26 is an alpha-quality branch and is not recommended for use in
 production.
 
 === Configuration changes in 1.26 ===
+* $wgEnableParserCache was deprecated, set $wgParserCacheType to CACHE_NONE
+  instead if you want to disable the parser cache.
 
 === New features in 1.26 ===
 * Change tags can now be hidden in the interface by disabling the associated
index d18b199..ad2307f 100644 (file)
@@ -152,7 +152,6 @@ Newtalk:
 
 Parser Cache:
        stored in: $parserMemc
-       controlled by: $wgEnableParserCache
        key: $wgDBname:pcache:idhash:$pageid-$renderkey!$hash
                $pageid: id of the page
                $renderkey: 1 if action=render, 0 otherwise
index 2ea8b29..bd0fbc2 100644 (file)
@@ -2369,13 +2369,8 @@ $wgUseFileCache = false;
 $wgFileCacheDepth = 2;
 
 /**
- * Keep parsed pages in a cache (objectcache table or memcached)
- * to speed up output of the same page viewed by another user with the
- * same options.
- *
- * This can provide a significant speedup for medium to large pages,
- * so you probably want to keep it on. Extensions that conflict with the
- * parser cache should disable the cache on a per-page basis instead.
+ * Kept for extension compatibility; see $wgParserCacheType
+ * @deprecated 1.26
  */
 $wgEnableParserCache = true;
 
index 1324ed8..4671252 100644 (file)
@@ -105,6 +105,10 @@ if ( $wgGitInfoCacheDirectory === false && $wgCacheDirectory !== false ) {
        $wgGitInfoCacheDirectory = "{$wgCacheDirectory}/gitinfo";
 }
 
+if ( $wgEnableParserCache === false ) {
+       $wgParserCacheType = CACHE_NONE;
+}
+
 // Fix path to icon images after they were moved in 1.24
 if ( $wgRightsIcon ) {
        $wgRightsIcon = str_replace(
index 8ef3063..913fb0c 100644 (file)
@@ -1086,10 +1086,7 @@ class WikiPage implements Page, IDBAccessObject {
         * @return bool
         */
        public function isParserCacheUsed( ParserOptions $parserOptions, $oldid ) {
-               global $wgEnableParserCache;
-
-               return $wgEnableParserCache
-                       && $parserOptions->getStubThreshold() == 0
+               return $parserOptions->getStubThreshold() == 0
                        && $this->exists()
                        && ( $oldid === null || $oldid === 0 || $oldid === $this->getLatest() )
                        && $this->getContentHandler()->isParserCacheSupported();
@@ -2166,8 +2163,6 @@ class WikiPage implements Page, IDBAccessObject {
         *   - 'no-change': don't update the article count, ever
         */
        public function doEditUpdates( Revision $revision, User $user, array $options = array() ) {
-               global $wgEnableParserCache;
-
                $options += array(
                        'changed' => true,
                        'created' => false,
@@ -2188,12 +2183,9 @@ class WikiPage implements Page, IDBAccessObject {
                }
 
                // Save it to the parser cache
-               if ( $wgEnableParserCache ) {
-                       $parserCache = ParserCache::singleton();
-                       $parserCache->save(
-                               $editInfo->output, $this, $editInfo->popts, $editInfo->timestamp, $editInfo->revid
-                       );
-               }
+               ParserCache::singleton()->save(
+                       $editInfo->output, $this, $editInfo->popts, $editInfo->timestamp, $editInfo->revid
+               );
 
                // Update the links tables and other secondary data
                if ( $content ) {
index 1cffa20..cc0df7a 100644 (file)
@@ -155,7 +155,7 @@ class ParserTest {
 
        static function setUp() {
                global $wgParser, $wgParserConf, $IP, $messageMemc, $wgMemc,
-                       $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache,
+                       $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory,
                        $wgExtraNamespaces, $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo,
                        $wgExtraInterlanguageLinkPrefixes, $wgLocalInterwikis,
                        $parserMemc, $wgThumbnailScriptPath, $wgScriptPath,
@@ -211,7 +211,6 @@ class ParserTest {
                        $wgParserCacheType = CACHE_NONE;
                }
 
-               $wgEnableParserCache = false;
                DeferredUpdates::clearPendingUpdates();
                $wgMemc = wfGetMainCache(); // checks $wgMainCacheType
                $messageMemc = wfGetMessageCacheStorage();
index 91aad10..c7a3103 100644 (file)
@@ -91,7 +91,7 @@ class NewParserTest extends MediaWikiTestCase {
                );
                $tmpGlobals['wgForeignFileRepos'] = array();
                $tmpGlobals['wgDefaultExternalStore'] = array();
-               $tmpGlobals['wgEnableParserCache'] = false;
+               $tmpGlobals['wgParserCacheType'] = CACHE_NONE;
                $tmpGlobals['wgCapitalLinks'] = true;
                $tmpGlobals['wgNoFollowLinks'] = true;
                $tmpGlobals['wgNoFollowDomainExceptions'] = array();
index d4a7bd3..e867250 100644 (file)
@@ -18,7 +18,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
        protected function setUp() {
                global $wgParser, $wgParserConf, $IP, $messageMemc, $wgMemc, $wgUser,
                        $wgLang, $wgOut, $wgRequest, $wgStyleDirectory,
-                       $wgEnableParserCache, $wgNamespaceAliases, $wgNamespaceProtection,
+                       $wgParserCacheType, $wgNamespaceAliases, $wgNamespaceProtection,
                        $parserMemc;
 
                $tmpGlobals = array();
@@ -56,7 +56,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
                $wgNamespaceAliases['Image'] = NS_FILE;
                $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK;
 
-               $wgEnableParserCache = false;
+               $wgParserCacheType = CACHE_NONE;
                DeferredUpdates::clearPendingUpdates();
                $wgMemc = wfGetMainCache();
                $messageMemc = wfGetMessageCacheStorage();