introducing ContentHandler::isParserCacheSupported()
authordaniel <daniel.kinzler@wikimedia.de>
Tue, 24 Apr 2012 10:06:23 +0000 (12:06 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Tue, 24 Apr 2012 10:06:47 +0000 (12:06 +0200)
includes/ContentHandler.php
includes/WikiPage.php

index 82fb049..d3acfa3 100644 (file)
@@ -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;
+       }
 }
 
 
index b34ab39..490083d 100644 (file)
@@ -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(); 
        }
 
        /**