Merge "Removed obsolete "containsOldMagic" code"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 4 Mar 2015 06:02:04 +0000 (06:02 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 4 Mar 2015 06:02:04 +0000 (06:02 +0000)
includes/OutputPage.php
includes/parser/CacheTime.php
includes/parser/ParserCache.php
includes/parser/ParserOutput.php
includes/poolcounter/PoolWorkArticleView.php

index 5c146e4..4070822 100644 (file)
@@ -196,12 +196,6 @@ class OutputPage extends ContextSource {
 
        // Parser related.
 
-       /**
-        * @var int
-        * @todo Unused?
-        */
-       private $mContainsOldMagic = 0;
-
        /** @var int */
        protected $mContainsNewMagic = 0;
 
index e382cf3..950c0d4 100644 (file)
@@ -35,7 +35,6 @@ class CacheTime {
        public $mVersion = Parser::VERSION,  # Compatibility check
                $mCacheTime = '',             # Time when this object was generated, or -1 for uncacheable. Used in ParserCache.
                $mCacheExpiry = null,         # Seconds after which the object should expire, use 0 for uncacheable. Used in ParserCache.
-               $mContainsOldMagic,           # Boolean variable indicating if the input contained variables like {{CURRENTDAY}}
                $mCacheRevisionId = null;     # Revision ID that was parsed
 
        /**
@@ -45,21 +44,6 @@ class CacheTime {
                return wfTimestamp( TS_MW, $this->mCacheTime );
        }
 
-       /**
-        * @return bool
-        */
-       public function containsOldMagic() {
-               return $this->mContainsOldMagic;
-       }
-
-       /**
-        * @param bool $com
-        * @return bool
-        */
-       public function setContainsOldMagic( $com ) {
-               return wfSetVar( $this->mContainsOldMagic, $com );
-       }
-
        /**
         * setCacheTime() sets the timestamp expressing when the page has been rendered.
         * This does not control expiry, see updateCacheExpiry() for that!
@@ -133,10 +117,6 @@ class CacheTime {
                        $expire = min( $expire, $wgParserCacheExpireTime );
                }
 
-               if ( $this->containsOldMagic() ) { //compatibility hack
-                       $expire = min( $expire, 3600 ); # 1 hour
-               }
-
                if ( $expire <= 0 ) {
                        return 0; // not cacheable
                } else {
index ad131f4..bc8e4a6 100644 (file)
@@ -257,8 +257,6 @@ class ParserCache {
                        $optionsKey->setCacheRevisionId( $revId );
                        $parserOutput->setCacheRevisionId( $revId );
 
-                       $optionsKey->setContainsOldMagic( $parserOutput->containsOldMagic() );
-
                        $parserOutputKey = $this->getParserOutputKey( $page,
                                $popts->optionsHash( $optionsKey->mUsedOptions, $page->getTitle() ) );
 
index f249017..bae3eaa 100644 (file)
@@ -62,12 +62,11 @@ class ParserOutput extends CacheTime {
                '#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#';
 
        public function __construct( $text = '', $languageLinks = array(), $categoryLinks = array(),
-               $containsOldMagic = false, $titletext = ''
+               $unused = false, $titletext = ''
        ) {
                $this->mText = $text;
                $this->mLanguageLinks = $languageLinks;
                $this->mCategories = $categoryLinks;
-               $this->mContainsOldMagic = $containsOldMagic;
                $this->mTitleText = $titletext;
        }
 
index 54cbb27..a702d2e 100644 (file)
@@ -154,7 +154,7 @@ class PoolWorkArticleView extends PoolCounterWork {
                // Make sure file cache is not used on uncacheable content.
                // Output that has magic words in it can still use the parser cache
                // (if enabled), though it will generally expire sooner.
-               if ( !$this->parserOutput->isCacheable() || $this->parserOutput->containsOldMagic() ) {
+               if ( !$this->parserOutput->isCacheable() ) {
                        $wgUseFileCache = false;
                }