From 25d53af4d2b1fdd0eaa0878c4d5b6c6e8f9f7394 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 24 Apr 2012 12:06:23 +0200 Subject: [PATCH] introducing ContentHandler::isParserCacheSupported() --- includes/ContentHandler.php | 10 ++++++++++ includes/WikiPage.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/includes/ContentHandler.php b/includes/ContentHandler.php index 82fb0496ad..d3acfa303f 100644 --- a/includes/ContentHandler.php +++ b/includes/ContentHandler.php @@ -637,6 +637,16 @@ abstract class ContentHandler { return $undone_content; } + + /** + * Returns true for content models that support caching using the ParserCache mechanism. + * See WikiPage::isParserCacheUser(). + * + * @return book + */ + public function isParserCacheSupported() { + return true; + } } diff --git a/includes/WikiPage.php b/includes/WikiPage.php index b34ab390b4..490083d583 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -883,7 +883,7 @@ class WikiPage extends Page { && $parserOptions->getStubThreshold() == 0 && $this->mTitle->exists() && ( $oldid === null || $oldid === 0 || $oldid === $this->getLatest() ) - && $this->mTitle->isWikitextPage(); #FIXME: ask ContentHandler if cachable! + && $this->getContentHandler()->isParserCacheSupported(); } /** -- 2.20.1