Remove ContentHandler functions with no usages at all
[lhc/web/wiklou.git] / includes / page / Article.php
index 4fdbdea..ac363b2 100644 (file)
@@ -210,7 +210,7 @@ class Article implements Page {
         * @return string Return the text of this revision
         */
        public function getContent() {
-               ContentHandler::deprecated( __METHOD__, '1.21' );
+               wfDeprecated( __METHOD__, '1.21' );
                $content = $this->getContentObject();
                return ContentHandler::getContentText( $content );
        }
@@ -347,7 +347,11 @@ class Article implements Page {
 
                // @todo Get rid of mContent everywhere!
                $this->mContent = ContentHandler::getContentText( $content );
-               ContentHandler::runLegacyHooks( 'ArticleAfterFetchContent', [ &$this, &$this->mContent ] );
+               ContentHandler::runLegacyHooks(
+                       'ArticleAfterFetchContent',
+                       [ &$this, &$this->mContent ],
+                       '1.21'
+               );
 
                return $this->mContent;
        }
@@ -424,7 +428,11 @@ class Article implements Page {
                $this->mContentObject = $content;
                $this->mRevIdFetched = $this->mRevision->getId();
 
-               Hooks::run( 'ArticleAfterFetchContentObject', [ &$this, &$this->mContentObject ] );
+               ContentHandler::runLegacyHooks(
+                       'ArticleAfterFetchContentObject',
+                       [ &$this, &$this->mContentObject ],
+                       '1.21'
+               );
 
                return $this->mContentObject;
        }
@@ -698,6 +706,10 @@ class Article implements Page {
                        }
                }
 
+               # Use adaptive TTLs for CDN so delayed/failed purges are noticed less often.
+               # This could use getTouched(), but that could be scary for major template edits.
+               $outputPage->adaptCdnTTL( $this->mPage->getTimestamp(), IExpiringStore::TTL_DAY );
+
                # Check for any __NOINDEX__ tags on the page using $pOutput
                $policy = $this->getRobotPolicy( 'view', $pOutput );
                $outputPage->setIndexPolicy( $policy['index'] );
@@ -707,7 +719,6 @@ class Article implements Page {
                $this->mPage->doViewUpdates( $user, $oldid );
 
                $outputPage->addModules( 'mediawiki.action.view.postEdit' );
-
        }
 
        /**
@@ -1173,10 +1184,6 @@ class Article implements Page {
                        return false;
                }
 
-               $rcid = $rc->getAttribute( 'rc_id' );
-
-               $token = $user->getEditToken( $rcid );
-
                $outputPage->preventClickjacking();
                if ( $wgEnableAPI && $wgEnableWriteAPI && $user->isAllowed( 'writeapi' ) ) {
                        $outputPage->addModules( 'mediawiki.page.patrol.ajax' );
@@ -1188,8 +1195,7 @@ class Article implements Page {
                        [],
                        [
                                'action' => 'markpatrolled',
-                               'rcid' => $rcid,
-                               'token' => $token,
+                               'rcid' => $rc->getAttribute( 'rc_id' ),
                        ]
                );
 
@@ -2325,16 +2331,6 @@ class Article implements Page {
                return $this->mPage->getRevision();
        }
 
-       /**
-        * Call to WikiPage function for backwards compatibility.
-        * @see WikiPage::getText
-        * @deprecated since 1.21 use WikiPage::getContent() instead
-        */
-       public function getText( $audience = Revision::FOR_PUBLIC, User $user = null ) {
-               wfDeprecated( __METHOD__, '1.21' );
-               return $this->mPage->getText( $audience, $user );
-       }
-
        /**
         * Call to WikiPage function for backwards compatibility.
         * @see WikiPage::getTimestamp
@@ -2497,15 +2493,6 @@ class Article implements Page {
                );
        }
 
-       /**
-        * Call to WikiPage function for backwards compatibility.
-        * @deprecated since 1.21, use prepareContentForEdit
-        * @see WikiPage::prepareTextForEdit
-        */
-       public function prepareTextForEdit( $text, $revid = null, User $user = null ) {
-               return $this->mPage->prepareTextForEdit( $text, $revid, $user );
-       }
-
        /**
         * Call to WikiPage function for backwards compatibility.
         * @see WikiPage::protectDescription