Update for rename of WikiPage::isParserCacheUsed() in I7de67937f0

Make the code compatible with both the old name (WikiPage::isParserCacheUsed)
and new name (WikiPage::shouldCheckParserCache).

Change-Id: If5d5da8eab132eb6d60f7141884ed2aeaa46e444
This commit is contained in:
Ori Livneh 2015-06-22 20:38:28 -07:00
parent 9a27b49107
commit 7c1ea48971

View file

@ -167,7 +167,12 @@ class ApiQueryExtracts extends ApiQueryBase {
$this->parserOptions = new ParserOptions( new User( '127.0.0.1' ) ); $this->parserOptions = new ParserOptions( new User( '127.0.0.1' ) );
} }
// first try finding full page in parser cache // first try finding full page in parser cache
if ( $page->isParserCacheUsed( $this->parserOptions, 0 ) ) { if ( method_exists( $page, 'isParserCachedUsed' ) ) {
$useCache = $page->isParserCacheUsed( $this->parserOptions, 0 );
} else {
$useCache = $page->shouldCheckParserCache( $this->parserOptions, 0 );
}
if ( $useCache ) {
$pout = ParserCache::singleton()->get( $page, $this->parserOptions ); $pout = ParserCache::singleton()->get( $page, $this->parserOptions );
if ( $pout ) { if ( $pout ) {
$pout->setTOCEnabled( false ); $pout->setTOCEnabled( false );