Merge "Use addDescription() instead of accessing mDescription directly"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 30 Jan 2016 13:53:11 +0000 (13:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 30 Jan 2016 13:53:11 +0000 (13:53 +0000)
RELEASE-NOTES-1.27
includes/api/ApiBase.php
includes/api/ApiQuerySiteinfo.php
includes/db/loadbalancer/LoadBalancer.php
includes/logging/LogFormatter.php
includes/mail/EmailNotification.php
includes/page/Article.php
includes/session/SessionManager.php
includes/specials/SpecialVersion.php
languages/i18n/en.json
languages/i18n/qqq.json

index 35ce6c2..c5356c1 100644 (file)
@@ -209,6 +209,7 @@ production.
 * ApiQueryBase::getDirectionDescription() was removed (deprecated since 1.25).
 * ApiQuery::getModules() was removed (deprecated since 1.21).
 * ApiMain::getModules() was removed (deprecated since 1.21).
+* ApiBase::getVersion() was removed (deprecated since 1.21).
 
 === Languages updated in 1.27 ===
 
index 425a337..02720c0 100644 (file)
@@ -2522,19 +2522,6 @@ abstract class ApiBase extends ContextSource {
        /// @deprecated since 1.24
        const PROP_NULLABLE = 1;
 
-       /**
-        * Formerly returned a string that identifies the version of the extending
-        * class. Typically included the class name, the svn revision, timestamp,
-        * and last author. Usually done with SVN's Id keyword
-        *
-        * @deprecated since 1.21, version string is no longer supported
-        * @return string
-        */
-       public function getVersion() {
-               wfDeprecated( __METHOD__, '1.21' );
-               return '';
-       }
-
        /**
         * Formerly used to fetch a list of possible properites in the result,
         * somehow organized with respect to the prop parameter that causes them to
index ca9ceca..196c1fa 100644 (file)
@@ -184,11 +184,6 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                        $data['git-hash'] = $git;
                        $data['git-branch'] =
                                SpecialVersion::getGitCurrentBranch( $GLOBALS['IP'] );
-               } else {
-                       $svn = SpecialVersion::getSvnRevision( $IP );
-                       if ( $svn ) {
-                               $data['rev'] = $svn;
-                       }
                }
 
                // 'case-insensitive' option is reserved for future
@@ -602,11 +597,6 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                                }
                                if ( isset( $ext['version'] ) ) {
                                        $ret['version'] = $ext['version'];
-                               } elseif ( isset( $ext['svn-revision'] ) &&
-                                       preg_match( '/\$(?:Rev|LastChangedRevision|Revision): *(\d+)/',
-                                               $ext['svn-revision'], $m )
-                               ) {
-                                       $ret['version'] = 'r' . $m[1];
                                }
                                if ( isset( $ext['path'] ) ) {
                                        $extensionPath = dirname( $ext['path'] );
@@ -620,13 +610,6 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                                                if ( $vcsDate !== false ) {
                                                        $ret['vcs-date'] = wfTimestamp( TS_ISO_8601, $vcsDate );
                                                }
-                                       } else {
-                                               $svnInfo = SpecialVersion::getSvnInfo( $extensionPath );
-                                               if ( $svnInfo !== false ) {
-                                                       $ret['vcs-system'] = 'svn';
-                                                       $ret['vcs-version'] = $svnInfo['checkout-rev'];
-                                                       $ret['vcs-url'] = isset( $svnInfo['viewvc-url'] ) ? $svnInfo['viewvc-url'] : '';
-                                               }
                                        }
 
                                        if ( SpecialVersion::getExtLicenseFileName( $extensionPath ) ) {
index 97df0d6..7199389 100644 (file)
@@ -1364,7 +1364,7 @@ class LoadBalancer {
         * case on many installations.
         *
         * @param IDatabase $conn
-        * @return int
+        * @return int|bool Returns false on error
         */
        public function safeGetLag( IDatabase $conn ) {
                if ( $this->getServerCount() == 1 ) {
index e2d9946..b99cb41 100644 (file)
@@ -67,7 +67,7 @@ class LogFormatter {
        /**
         * Handy shortcut for constructing a formatter directly from
         * database row.
-        * @param object $row
+        * @param stdClass|array $row
         * @see DatabaseLogEntry::getSelectQueryData
         * @return LogFormatter
         */
@@ -237,7 +237,7 @@ class LogFormatter {
                                        // @codingStandardsIgnoreStart Long line
                                        //case 'revision': // Revision deletion
                                        //case 'event': // Log deletion
-                                       // see https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/LogPage.php?&pathrev=97044&r1=97043&r2=97044
+                                       // see https://github.com/wikimedia/mediawiki/commit/a9c243b7b5289dad204278dbe7ed571fd914e395
                                        //default:
                                        // @codingStandardsIgnoreEnd
                                }
@@ -245,7 +245,7 @@ class LogFormatter {
 
                        case 'patrol':
                                // @codingStandardsIgnoreStart Long line
-                               // https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/PatrolLog.php?&pathrev=97495&r1=97494&r2=97495
+                               // https://github.com/wikimedia/mediawiki/commit/1a05f8faf78675dc85984f27f355b8825b43efff
                                // @codingStandardsIgnoreEnd
                                // Create a diff link to the patrolled revision
                                if ( $entry->getSubtype() === 'patrol' ) {
index e51b434..8bac6b8 100644 (file)
@@ -166,22 +166,21 @@ class EmailNotification {
                        }
                }
 
-               if ( !$sendEmail ) {
-                       return;
+               if ( $sendEmail ) {
+                       JobQueueGroup::singleton()->lazyPush( new EnotifNotifyJob(
+                               $title,
+                               array(
+                                       'editor' => $editor->getName(),
+                                       'editorID' => $editor->getID(),
+                                       'timestamp' => $timestamp,
+                                       'summary' => $summary,
+                                       'minorEdit' => $minorEdit,
+                                       'oldid' => $oldid,
+                                       'watchers' => $watchers,
+                                       'pageStatus' => $pageStatus
+                               )
+                       ) );
                }
-
-               $params = array(
-                       'editor' => $editor->getName(),
-                       'editorID' => $editor->getID(),
-                       'timestamp' => $timestamp,
-                       'summary' => $summary,
-                       'minorEdit' => $minorEdit,
-                       'oldid' => $oldid,
-                       'watchers' => $watchers,
-                       'pageStatus' => $pageStatus
-               );
-               $job = new EnotifNotifyJob( $title, $params );
-               JobQueueGroup::singleton()->lazyPush( $job );
        }
 
        /**
index f16158b..938c049 100644 (file)
@@ -2084,22 +2084,574 @@ class Article implements Page {
        }
 
        /**
-        * Use PHP's magic __call handler to transform instance calls to
-        * WikiPage functions for backwards compatibility.
-        *
-        * @param string $fname Name of called method
-        * @param array $args Arguments to the method
-        * @return mixed
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::checkFlags
         */
-       public function __call( $fname, $args ) {
-               if ( is_callable( array( $this->mPage, $fname ) ) ) {
-                       # wfWarn( "Call to " . __CLASS__ . "::$fname; please use WikiPage instead" );
-                       return call_user_func_array( array( $this->mPage, $fname ), $args );
-               }
-               trigger_error( 'Inaccessible function via __call(): ' . $fname, E_USER_ERROR );
+       public function checkFlags( $flags ) {
+               return $this->mPage->checkFlags( $flags );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::checkTouched
+        */
+       public function checkTouched() {
+               return $this->mPage->checkTouched();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::clearPreparedEdit
+        */
+       public function clearPreparedEdit() {
+               return $this->mPage->clearPreparedEdit();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::doDeleteArticleReal
+        */
+       public function doDeleteArticleReal(
+               $reason, $suppress = false, $u1 = null, $u2 = null, &$error = '', User $user = null
+       ) {
+               return $this->mPage->doDeleteArticleReal(
+                       $reason, $suppress, $u1, $u2, $error, $user
+               );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::doDeleteUpdates
+        */
+       public function doDeleteUpdates( $id, Content $content = null ) {
+               return $this->mPage->doDeleteUpdates( $id, $content );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::doEdit
+        */
+       public function doEdit( $text, $summary, $flags = 0, $baseRevId = false, $user = null ) {
+               ContentHandler::deprecated( __METHOD__, '1.21' );
+               return $this->mPage->doEdit( $text, $summary, $flags, $baseRevId, $user );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::doEditContent
+        */
+       public function doEditContent( Content $content, $summary, $flags = 0, $baseRevId = false,
+               User $user = null, $serialFormat = null
+       ) {
+               return $this->mPage->doEditContent( $content, $summary, $flags, $baseRevId,
+                       $user, $serialFormat
+               );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::doEditUpdates
+        */
+       public function doEditUpdates( Revision $revision, User $user, array $options = array() ) {
+               return $this->mPage->doEditUpdates( $revision, $user, $options );
        }
 
-       // ****** B/C functions to work-around PHP silliness with __call and references ****** //
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::doPurge
+        */
+       public function doPurge() {
+               return $this->mPage->doPurge();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::doQuickEditContent
+        */
+       public function doQuickEditContent(
+               Content $content, User $user, $comment = '', $minor = false, $serialFormat = null
+       ) {
+               return $this->mPage->doQuickEditContent(
+                       $content, $user, $comment, $minor, $serialFormat
+               );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::doViewUpdates
+        */
+       public function doViewUpdates( User $user, $oldid = 0 ) {
+               return $this->mPage->doViewUpdates( $user, $oldid );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::exists
+        */
+       public function exists() {
+               return $this->mPage->exists();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::followRedirect
+        */
+       public function followRedirect() {
+               return $this->mPage->followRedirect();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getActionOverrides
+        */
+       public function getActionOverrides() {
+               return $this->mPage->getActionOverrides();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getAutoDeleteReason
+        */
+       public function getAutoDeleteReason( &$hasHistory ) {
+               return $this->mPage->getAutoDeleteReason( $hasHistory );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getCategories
+        */
+       public function getCategories() {
+               return $this->mPage->getCategories();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getComment
+        */
+       public function getComment( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+               return $this->mPage->getComment( $audience, $user );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getContentHandler
+        */
+       public function getContentHandler() {
+               return $this->mPage->getContentHandler();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getContentModel
+        */
+       public function getContentModel() {
+               return $this->mPage->getContentModel();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getContributors
+        */
+       public function getContributors() {
+               return $this->mPage->getContributors();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getCreator
+        */
+       public function getCreator( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+               return $this->mPage->getCreator( $audience, $user );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getDeletionUpdates
+        */
+       public function getDeletionUpdates( Content $content = null ) {
+               return $this->mPage->getDeletionUpdates( $content );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getHiddenCategories
+        */
+       public function getHiddenCategories() {
+               return $this->mPage->getHiddenCategories();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getId
+        */
+       public function getId() {
+               return $this->mPage->getId();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getLatest
+        */
+       public function getLatest() {
+               return $this->mPage->getLatest();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getLinksTimestamp
+        */
+       public function getLinksTimestamp() {
+               return $this->mPage->getLinksTimestamp();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getMinorEdit
+        */
+       public function getMinorEdit() {
+               return $this->mPage->getMinorEdit();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getOldestRevision
+        */
+       public function getOldestRevision() {
+               return $this->mPage->getOldestRevision();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getRedirectTarget
+        */
+       public function getRedirectTarget() {
+               return $this->mPage->getRedirectTarget();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getRedirectURL
+        */
+       public function getRedirectURL( $rt ) {
+               return $this->mPage->getRedirectURL( $rt );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getRevision
+        */
+       public function getRevision() {
+               return $this->mPage->getRevision();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getText
+        */
+       public function getText( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+               ContentHandler::deprecated( __METHOD__, '1.21' );
+               return $this->mPage->getText( $audience, $user );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getTimestamp
+        */
+       public function getTimestamp() {
+               return $this->mPage->getTimestamp();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getTouched
+        */
+       public function getTouched() {
+               return $this->mPage->getTouched();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getUndoContent
+        */
+       public function getUndoContent( Revision $undo, Revision $undoafter = null ) {
+               return $this->mPage->getUndoContent( $undo, $undoafter );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getUndoText
+        */
+       public function getUndoText( Revision $undo, Revision $undoafter = null ) {
+               ContentHandler::deprecated( __METHOD__, '1.21' );
+               return $this->mPage->getUndoText( $undo, $undoafter );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getUser
+        */
+       public function getUser( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+               return $this->mPage->getUser( $audience, $user );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::getUserText
+        */
+       public function getUserText( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+               return $this->mPage->getUserText( $audience, $user );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::hasViewableContent
+        */
+       public function hasViewableContent() {
+               return $this->mPage->hasViewableContent();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::insertOn
+        */
+       public function insertOn( $dbw, $pageId = null ) {
+               return $this->mPage->insertOn( $dbw, $pageId );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::insertProtectNullRevision
+        */
+       public function insertProtectNullRevision( $revCommentMsg, array $limit,
+               array $expiry, $cascade, $reason, $user = null
+       ) {
+               return $this->mPage->insertProtectNullRevision( $revCommentMsg, $limit,
+                       $expiry, $cascade, $reason, $user
+               );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::insertRedirect
+        */
+       public function insertRedirect() {
+               return $this->mPage->insertRedirect();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::insertRedirectEntry
+        */
+       public function insertRedirectEntry( Title $rt, $oldLatest = null ) {
+               return $this->mPage->insertRedirectEntry( $rt, $oldLatest );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::isCountable
+        */
+       public function isCountable( $editInfo = false ) {
+               return $this->mPage->isCountable( $editInfo );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::isRedirect
+        */
+       public function isRedirect() {
+               return $this->mPage->isRedirect();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::loadFromRow
+        */
+       public function loadFromRow( $data, $from ) {
+               return $this->mPage->loadFromRow( $data, $from );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::loadPageData
+        */
+       public function loadPageData( $from = 'fromdb' ) {
+               return $this->mPage->loadPageData( $from );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::lockAndGetLatest
+        */
+       public function lockAndGetLatest() {
+               return $this->mPage->lockAndGetLatest();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::makeParserOptions
+        */
+       public function makeParserOptions( $context ) {
+               return $this->mPage->makeParserOptions( $context );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::pageDataFromId
+        */
+       public function pageDataFromId( $dbr, $id, $options = array() ) {
+               return $this->mPage->pageDataFromId( $dbr, $id, $options );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::pageDataFromTitle
+        */
+       public function pageDataFromTitle( $dbr, $title, $options = array() ) {
+               return $this->mPage->pageDataFromTitle( $dbr, $title, $options );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::prepareContentForEdit
+        */
+       public function prepareContentForEdit(
+               Content $content, $revision = null, User $user = null,
+               $serialFormat = null, $useCache = true
+       ) {
+               return $this->mPage->prepareContentForEdit(
+                       $content, $revision, $user,
+                       $serialFormat, $useCache
+               );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @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
+        */
+       public function protectDescription( array $limit, array $expiry ) {
+               return $this->mPage->protectDescription( $limit, $expiry );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::protectDescriptionLog
+        */
+       public function protectDescriptionLog( array $limit, array $expiry ) {
+               return $this->mPage->protectDescriptionLog( $limit, $expiry );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::replaceSection
+        */
+       public function replaceSection( $sectionId, $text, $sectionTitle = '',
+               $edittime = null
+       ) {
+               ContentHandler::deprecated( __METHOD__, '1.21' );
+               return $this->mPage->replaceSection( $sectionId, $text, $sectionTitle,
+                       $edittime
+               );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::replaceSectionAtRev
+        */
+       public function replaceSectionAtRev( $sectionId, Content $sectionContent,
+               $sectionTitle = '', $baseRevId = null
+       ) {
+               return $this->mPage->replaceSectionAtRev( $sectionId, $sectionContent,
+                       $sectionTitle, $baseRevId
+               );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::replaceSectionContent
+        */
+       public function replaceSectionContent(
+               $sectionId, Content $sectionContent, $sectionTitle = '', $edittime = null
+       ) {
+               return $this->mPage->replaceSectionContent(
+                       $sectionId, $sectionContent, $sectionTitle, $edittime
+               );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::setTimestamp
+        */
+       public function setTimestamp( $ts ) {
+               return $this->mPage->setTimestamp( $ts );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::shouldCheckParserCache
+        */
+       public function shouldCheckParserCache( ParserOptions $parserOptions, $oldId ) {
+               return $this->mPage->shouldCheckParserCache( $parserOptions, $oldId );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::supportsSections
+        */
+       public function supportsSections() {
+               return $this->mPage->supportsSections();
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::triggerOpportunisticLinksUpdate
+        */
+       public function triggerOpportunisticLinksUpdate( ParserOutput $parserOutput ) {
+               return $this->mPage->triggerOpportunisticLinksUpdate( $parserOutput );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::updateCategoryCounts
+        */
+       public function updateCategoryCounts( array $added, array $deleted ) {
+               return $this->mPage->updateCategoryCounts( $added, $deleted );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::updateIfNewerOn
+        */
+       public function updateIfNewerOn( $dbw, $revision ) {
+               return $this->mPage->updateIfNewerOn( $dbw, $revision );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::updateRedirectOn
+        */
+       public function updateRedirectOn( $dbw, $redirectTitle, $lastRevIsRedirect = null ) {
+               return $this->mPage->updateRedirectOn( $dbw, $redirectTitle, $lastRevIsRedirect = null );
+       }
+
+       /**
+        * Call to WikiPage function for backwards compatibility.
+        * @see WikiPage::updateRevisionOn
+        */
+       public function updateRevisionOn( $dbw, $revision, $lastRevision = null,
+               $lastRevIsRedirect = null
+       ) {
+               return $this->mPage->updateRevisionOn( $dbw, $revision, $lastRevision,
+                       $lastRevIsRedirect
+               );
+       }
 
        /**
         * @param array $limit
@@ -2185,8 +2737,6 @@ class Article implements Page {
                return $handler->getAutoDeleteReason( $title, $hasHistory );
        }
 
-       // ****** B/C functions for static methods ( __callStatic is PHP>=5.3 ) ****** //
-
        /**
         * @return array
         *
index 0441137..6b221fd 100644 (file)
@@ -539,7 +539,7 @@ final class SessionManager implements SessionManagerInterface {
                // Reset the user's token to kill existing sessions
                $user = User::newFromName( $username );
                if ( $user && $user->getToken( false ) ) {
-                       $user->setToken( true );
+                       $user->setToken();
                        $user->saveSettings();
                }
 
index 43228fa..a628902 100644 (file)
@@ -38,12 +38,6 @@ class SpecialVersion extends SpecialPage {
 
        protected static $extensionTypes = false;
 
-       protected static $viewvcUrls = array(
-               'svn+ssh://svn.wikimedia.org/svnroot/mediawiki' => 'http://svn.wikimedia.org/viewvc/mediawiki',
-               'http://svn.wikimedia.org/svnroot/mediawiki' => 'http://svn.wikimedia.org/viewvc/mediawiki',
-               'https://svn.wikimedia.org/svnroot/mediawiki' => 'https://svn.wikimedia.org/viewvc/mediawiki',
-       );
-
        public function __construct() {
                parent::__construct( 'Version' );
        }
@@ -258,7 +252,7 @@ class SpecialVersion extends SpecialPage {
        }
 
        /**
-        * Return a string of the MediaWiki version with SVN revision if available.
+        * Return a string of the MediaWiki version with Git revision if available.
         *
         * @param string $flags
         * @return mixed
@@ -267,25 +261,15 @@ class SpecialVersion extends SpecialPage {
                global $wgVersion, $IP;
 
                $gitInfo = self::getGitHeadSha1( $IP );
-               $svnInfo = self::getSvnInfo( $IP );
-               if ( !$svnInfo && !$gitInfo ) {
+               if ( !$gitInfo ) {
                        $version = $wgVersion;
-               } elseif ( $gitInfo && $flags === 'nodb' ) {
+               } elseif ( $flags === 'nodb' ) {
                        $shortSha1 = substr( $gitInfo, 0, 7 );
                        $version = "$wgVersion ($shortSha1)";
-               } elseif ( $gitInfo ) {
+               } else {
                        $shortSha1 = substr( $gitInfo, 0, 7 );
                        $shortSha1 = wfMessage( 'parentheses' )->params( $shortSha1 )->escaped();
                        $version = "$wgVersion $shortSha1";
-               } elseif ( $flags === 'nodb' ) {
-                       $version = "$wgVersion (r{$svnInfo['checkout-rev']})";
-               } else {
-                       $version = $wgVersion . ' ' .
-                               wfMessage(
-                                       'version-svn-revision',
-                                       isset( $svnInfo['directory-rev'] ) ? $svnInfo['directory-rev'] : '',
-                                       isset( $svnInfo['checkout-rev'] ) ? $svnInfo['checkout-rev'] : ''
-                               )->text();
                }
 
                return $version;
@@ -293,8 +277,7 @@ class SpecialVersion extends SpecialPage {
 
        /**
         * Return a wikitext-formatted string of the MediaWiki version with a link to
-        * the SVN revision or the git SHA1 of head if available.
-        * Git is prefered over Svn
+        * the Git SHA1 of head if available.
         * The fallback is just $wgVersion
         *
         * @return mixed
@@ -306,43 +289,12 @@ class SpecialVersion extends SpecialPage {
                if ( $gitVersion ) {
                        $v = $gitVersion;
                } else {
-                       $svnVersion = self::getVersionLinkedSvn();
-                       if ( $svnVersion ) {
-                               $v = $svnVersion;
-                       } else {
-                               $v = $wgVersion; // fallback
-                       }
+                       $v = $wgVersion; // fallback
                }
 
                return $v;
        }
 
-       /**
-        * @return string Global wgVersion + a link to subversion revision of svn BASE
-        */
-       private static function getVersionLinkedSvn() {
-               global $IP;
-
-               $info = self::getSvnInfo( $IP );
-               if ( !isset( $info['checkout-rev'] ) ) {
-                       return false;
-               }
-
-               $linkText = wfMessage(
-                       'version-svn-revision',
-                       isset( $info['directory-rev'] ) ? $info['directory-rev'] : '',
-                       $info['checkout-rev']
-               )->text();
-
-               if ( isset( $info['viewvc-url'] ) ) {
-                       $version = "[{$info['viewvc-url']} $linkText]";
-               } else {
-                       $version = $linkText;
-               }
-
-               return self::getwgVersionLinked() . " $version";
-       }
-
        /**
         * @return string
         */
@@ -744,7 +696,7 @@ class SpecialVersion extends SpecialPage {
                }
 
                // ... and the version information
-               // If the extension path is set we will check that directory for GIT and SVN
+               // If the extension path is set we will check that directory for GIT
                // metadata in an attempt to extract date and vcs commit metadata.
                $canonicalVersion = '&ndash;';
                $extensionPath = null;
@@ -764,11 +716,6 @@ class SpecialVersion extends SpecialPage {
                                $coreHeadSHA1 = self::getGitHeadSha1( $IP );
                                if ( $coreHeadSHA1 ) {
                                        $this->coreId = $coreHeadSHA1;
-                               } else {
-                                       $svnInfo = self::getSvnInfo( $IP );
-                                       if ( $svnInfo !== false ) {
-                                               $this->coreId = $svnInfo['checkout-rev'];
-                                       }
                                }
                        }
                        $cache = wfGetCache( CACHE_ANYTHING );
@@ -783,12 +730,6 @@ class SpecialVersion extends SpecialPage {
                                        $vcsVersion = substr( $vcsVersion, 0, 7 );
                                        $vcsLink = $gitInfo->getHeadViewUrl();
                                        $vcsDate = $gitInfo->getHeadCommitDate();
-                               } else {
-                                       $svnInfo = self::getSvnInfo( $extensionPath );
-                                       if ( $svnInfo !== false ) {
-                                               $vcsVersion = $this->msg( 'version-svn-revision', $svnInfo['checkout-rev'] )->text();
-                                               $vcsLink = isset( $svnInfo['viewvc-url'] ) ? $svnInfo['viewvc-url'] : '';
-                                       }
                                }
                                $cache->set( $memcKey, array( $vcsVersion, $vcsLink, $vcsDate ), 60 * 60 * 24 );
                        } else {
@@ -1154,108 +1095,6 @@ class SpecialVersion extends SpecialPage {
                }
        }
 
-       /**
-        * Get an associative array of information about a given path, from its .svn
-        * subdirectory. Returns false on error, such as if the directory was not
-        * checked out with subversion.
-        *
-        * Returned keys are:
-        *    Required:
-        *        checkout-rev          The revision which was checked out
-        *    Optional:
-        *        directory-rev         The revision when the directory was last modified
-        *        url                   The subversion URL of the directory
-        *        repo-url              The base URL of the repository
-        *        viewvc-url            A ViewVC URL pointing to the checked-out revision
-        * @param string $dir
-        * @return array|bool
-        */
-       public static function getSvnInfo( $dir ) {
-               // http://svnbook.red-bean.com/nightly/en/svn.developer.insidewc.html
-               $entries = $dir . '/.svn/entries';
-
-               if ( !file_exists( $entries ) ) {
-                       return false;
-               }
-
-               $lines = file( $entries );
-               if ( !count( $lines ) ) {
-                       return false;
-               }
-
-               // check if file is xml (subversion release <= 1.3) or not (subversion release = 1.4)
-               if ( preg_match( '/^<\?xml/', $lines[0] ) ) {
-                       // subversion is release <= 1.3
-                       if ( !function_exists( 'simplexml_load_file' ) ) {
-                               // We could fall back to expat... YUCK
-                               return false;
-                       }
-
-                       // SimpleXml whines about the xmlns...
-                       MediaWiki\suppressWarnings();
-                       $xml = simplexml_load_file( $entries );
-                       MediaWiki\restoreWarnings();
-
-                       if ( $xml ) {
-                               foreach ( $xml->entry as $entry ) {
-                                       if ( $xml->entry[0]['name'] == '' ) {
-                                               // The directory entry should always have a revision marker.
-                                               if ( $entry['revision'] ) {
-                                                       return array( 'checkout-rev' => intval( $entry['revision'] ) );
-                                               }
-                                       }
-                               }
-                       }
-
-                       return false;
-               }
-
-               // Subversion is release 1.4 or above.
-               if ( count( $lines ) < 11 ) {
-                       return false;
-               }
-
-               $info = array(
-                       'checkout-rev' => intval( trim( $lines[3] ) ),
-                       'url' => trim( $lines[4] ),
-                       'repo-url' => trim( $lines[5] ),
-                       'directory-rev' => intval( trim( $lines[10] ) )
-               );
-
-               if ( isset( self::$viewvcUrls[$info['repo-url']] ) ) {
-                       $viewvc = str_replace(
-                               $info['repo-url'],
-                               self::$viewvcUrls[$info['repo-url']],
-                               $info['url']
-                       );
-
-                       $viewvc .= '/?pathrev=';
-                       $viewvc .= urlencode( $info['checkout-rev'] );
-                       $info['viewvc-url'] = $viewvc;
-               }
-
-               return $info;
-       }
-
-       /**
-        * Retrieve the revision number of a Subversion working directory.
-        *
-        * @param string $dir Directory of the svn checkout
-        *
-        * @return int Revision number
-        */
-       public static function getSvnRevision( $dir ) {
-               $info = self::getSvnInfo( $dir );
-
-               if ( $info === false ) {
-                       return false;
-               } elseif ( isset( $info['checkout-rev'] ) ) {
-                       return $info['checkout-rev'];
-               } else {
-                       return false;
-               }
-       }
-
        /**
         * @param string $dir Directory of the git checkout
         * @return bool|string Sha1 of commit HEAD points to
index 639af0f..bf906d5 100644 (file)
        "version-hook-subscribedby": "Subscribed by",
        "version-version": "($1)",
        "version-no-ext-name": "[no name]",
-       "version-svn-revision": "r$1",
        "version-license": "MediaWiki License",
        "version-ext-license": "License",
        "version-ext-colheader-name": "Extension",
index 61aaeaa..d66e43e 100644 (file)
        "version-hook-subscribedby": "Shown in [[Special:Version]]",
        "version-version": "{{Optional}}\nUsed in [[Special:Version]]. Preceded by the MediaWiki extension name.\n\nParameters:\n* $1 - version number of the extension",
        "version-no-ext-name": "Used in [[Special:Version]], in the rows of the main table when a name for an extension is not provided.",
-       "version-svn-revision": "{{Identical|Revision}}{{optional}}\nUsed in [[Special:Version]], preceeding the Subversion revision numbers of the extensions loaded inside brackets, like this: \"({{int:version-revision}} r012345\"). Parameters:\n* $1 - (Unused) directory revision number or empty string\n* $2 - checkout revision number",
        "version-license": "Used specifically for the MediaWiki software.\n\nUsed as heading in [[Special:Version]].",
        "version-ext-license": "Used in [[Special:Version]].\n\nUsed as label for the link pointing to the extension's license page. e.g. [[Special:Version/License/Maps]]\n{{Identical|License}}",
        "version-ext-colheader-name": "Column header for the name of an extension.\n{{Identical|Extension}}",