Removed double hook explanation AfterFinalPageOutput
[lhc/web/wiklou.git] / includes / Article.php
index 1537ea6..09d843d 100644 (file)
  * @internal documentation reviewed 15 Mar 2010
  */
 class Article implements Page {
-       /**@{{
-        * @private
-        */
-
-       /**
-        * The context this Article is executed in
-        * @var IContextSource $mContext
-        */
+       /** @var IContextSource The context this Article is executed in */
        protected $mContext;
 
-       /**
-        * The WikiPage object of this instance
-        * @var WikiPage $mPage
-        */
+       /** @var WikiPage The WikiPage object of this instance */
        protected $mPage;
 
-       /**
-        * ParserOptions object for $wgUser articles
-        * @var ParserOptions $mParserOptions
-        */
+       /** @var ParserOptions ParserOptions object for $wgUser articles */
        public $mParserOptions;
 
        /**
-        * Text of the revision we are working on
-        * @var string $mContent
+        * @var string Text of the revision we are working on
+        * @todo BC cruft
         */
-       var $mContent;                    // !< #BC cruft
+       public $mContent;
 
        /**
-        * Content of the revision we are working on
-        * @var Content
+        * @var Content Content of the revision we are working on
         * @since 1.21
         */
-       var $mContentObject;              // !<
+       protected $mContentObject;
 
-       /**
-        * Is the content ($mContent) already loaded?
-        * @var bool $mContentLoaded
-        */
-       var $mContentLoaded = false;      // !<
+       /** @var bool Is the content ($mContent) already loaded? */
+       protected $mContentLoaded = false;
 
-       /**
-        * The oldid of the article that is to be shown, 0 for the
-        * current revision
-        * @var int|null $mOldId
-        */
-       var $mOldId;                      // !<
+       /** @var int|null The oldid of the article that is to be shown, 0 for the current revision */
+       protected $mOldId;
 
-       /**
-        * Title from which we were redirected here
-        * @var Title $mRedirectedFrom
-        */
-       var $mRedirectedFrom = null;
+       /** @var Title Title from which we were redirected here */
+       protected $mRedirectedFrom = null;
 
-       /**
-        * URL to redirect to or false if none
-        * @var string|false $mRedirectUrl
-        */
-       var $mRedirectUrl = false;        // !<
+       /** @var string|bool URL to redirect to or false if none */
+       protected $mRedirectUrl = false;
 
-       /**
-        * Revision ID of revision we are working on
-        * @var int $mRevIdFetched
-        */
-       var $mRevIdFetched = 0;           // !<
+       /** @var int Revision ID of revision we are working on */
+       protected $mRevIdFetched = 0;
 
-       /**
-        * Revision we are working on
-        * @var Revision $mRevision
-        */
-       var $mRevision = null;
+       /** @var Revision Revision we are working on */
+       protected $mRevision = null;
 
-       /**
-        * ParserOutput object
-        * @var ParserOutput $mParserOutput
-        */
-       var $mParserOutput;
-
-       /**@}}*/
+       /** @var ParserOutput */
+       public $mParserOutput;
 
        /**
         * Constructor and clear the article
@@ -372,7 +334,7 @@ class Article implements Page {
         * uses this method to retrieve page text from the database, so the function
         * has to remain public for now.
         *
-        * @return string|bool string containing article contents, or false if null
+        * @return string|bool String containing article contents, or false if null
         * @deprecated since 1.21, use WikiPage::getContent() instead
         */
        function fetchContent() { #BC cruft!
@@ -386,6 +348,11 @@ class Article implements Page {
 
                $content = $this->fetchContentObject();
 
+               if ( !$content ) {
+                       wfProfileOut( __METHOD__ );
+                       return false;
+               }
+
                // @todo Get rid of mContent everywhere!
                $this->mContent = ContentHandler::getContentText( $content );
                ContentHandler::runLegacyHooks( 'ArticleAfterFetchContent', array( &$this, &$this->mContent ) );
@@ -827,8 +794,9 @@ class Article implements Page {
         * Show a page view for a page formatted as CSS or JavaScript. To be called by
         * Article::view() only.
         *
-        * This is hooked by SyntaxHighlight_GeSHi to do syntax highlighting of these
-        * page views.
+        * This exists mostly to serve the deprecated ShowRawCssJs hook (used to customize these views).
+        * It has been replaced by the ContentGetParserOutput hook, which lets you do the same but with
+        * more flexibility.
         *
         * @param bool $showCacheHint Whether to show a message telling the user
         *   to clear the browser cache (default: true).
@@ -865,7 +833,7 @@ class Article implements Page {
         * @param string $action The action= GET parameter
         * @param ParserOutput|null $pOutput
         * @return array The policy that should be set
-        * TODO: actions other than 'view'
+        * @todo: actions other than 'view'
         */
        public function getRobotPolicy( $action, $pOutput = null ) {
                global $wgArticleRobotPolicies, $wgNamespaceRobotPolicies, $wgDefaultRobotPolicy;
@@ -944,7 +912,7 @@ class Article implements Page {
         * Converts a String robot policy into an associative array, to allow
         * merging of several policies using array_merge().
         * @param array|string $policy Returns empty array on null/false/'', transparent
-        *            to already-converted arrays, converts String.
+        *   to already-converted arrays, converts string.
         * @return array 'index' => \<indexpolicy\>, 'follow' => \<followpolicy\>
         */
        public static function formatRobotPolicy( $policy ) {