Remove buggy b/c logic in Parser::disableCache()/updateCacheExpiry()
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 23 Oct 2015 19:35:43 +0000 (12:35 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 23 Oct 2015 19:35:43 +0000 (12:35 -0700)
* Setting mCacheTime to -1 is for old callers that
  only check getCacheTime() instead of getCacheExpiry().
  Most of them are already broken (WikiLog/SemanticForms) as
  they check for -1 which is in fact never returned
  due to the TS_MW conversion in Parser::getCacheTime.
* By using -1, the value of page_links_updated can end up
  as 1969, which is confusing and broken.

Change-Id: I8809a4258eacff05992a2c27ade7f6a0c1731c51

includes/parser/CacheTime.php
includes/parser/Parser.php

index 7acfe38..2451390 100644 (file)
@@ -93,11 +93,6 @@ class CacheTime {
                if ( $this->mCacheExpiry === null || $this->mCacheExpiry > $seconds ) {
                        $this->mCacheExpiry = $seconds;
                }
-
-               // hack: set old-style marker for uncacheable entries.
-               if ( $this->mCacheExpiry !== null && $this->mCacheExpiry <= 0 ) {
-                       $this->mCacheTime = -1;
-               }
        }
 
        /**
index efad151..9060756 100644 (file)
@@ -5763,7 +5763,6 @@ class Parser {
                        throw new MWException( __METHOD__ .
                                " can only be called when actually parsing something" );
                }
-               $this->mOutput->setCacheTime( -1 ); // old style, for compatibility
                $this->mOutput->updateCacheExpiry( 0 ); // new style, for consistency
        }