Merge "Added some lock()/unlock() support for SQLite using lock file emulation"
[lhc/web/wiklou.git] / includes / content / ContentHandler.php
index 1abe1fa..7c51345 100644 (file)
@@ -677,12 +677,19 @@ abstract class ContentHandler {
         * typically based on the namespace or some other aspect of the title, such as a special suffix
         * (e.g. ".svg" for SVG content).
         *
+        * @note: this calls the ContentHandlerCanBeUsedOn hook which may be used to override which
+        * content model can be used where.
+        *
         * @param Title $title the page's title.
         *
         * @return bool true if content of this kind can be used on the given page, false otherwise.
         */
        public function canBeUsedOn( Title $title ) {
-               return true;
+               $ok = true;
+
+               wfRunHooks( 'ContentModelCanBeUsedOn', array( $this->getModelID(), $title, &$ok ) );
+
+               return $ok;
        }
 
        /**
@@ -935,7 +942,7 @@ abstract class ContentHandler {
        }
 
        /**
-        * Get parser options suitable for rendering the primary article wikitext
+        * Get parser options suitable for rendering and caching the article
         *
         * @param IContextSource|User|string $context One of the following:
         *        - IContextSource: Use the User and the Language of the provided
@@ -945,8 +952,6 @@ abstract class ContentHandler {
         *        - 'canonical': Canonical options (anonymous user with default
         *                                            preferences and content language).
         *
-        * @param IContextSource|User|string $context
-        *
         * @throws MWException
         * @return ParserOptions
         */