More of r113580
authorSam Reed <reedy@users.mediawiki.org>
Sun, 11 Mar 2012 22:05:54 +0000 (22:05 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 11 Mar 2012 22:05:54 +0000 (22:05 +0000)
includes/EditPage.php
includes/Revision.php
includes/Skin.php
includes/SkinLegacy.php
includes/SkinTemplate.php
includes/Title.php
includes/WikiPage.php
includes/actions/InfoAction.php
includes/cache/LinkBatch.php

index 287ed97..dc107ad 100644 (file)
@@ -376,7 +376,7 @@ class EditPage {
                                wfProfileOut( __METHOD__ );
                                return;
                        }
-                       if ( !$this->mTitle->getArticleId() )
+                       if ( !$this->mTitle->getArticleID() )
                                wfRunHooks( 'EditFormPreloadText', array( &$this->textbox1, &$this->mTitle ) );
                        else
                                wfRunHooks( 'EditFormInitialText', array( $this ) );
@@ -805,7 +805,7 @@ class EditPage {
                                        # Otherwise, $text will be left as-is.
                                        if ( !is_null( $undorev ) && !is_null( $oldrev ) &&
                                                $undorev->getPage() == $oldrev->getPage() &&
-                                               $undorev->getPage() == $this->mTitle->getArticleId() &&
+                                               $undorev->getPage() == $this->mTitle->getArticleID() &&
                                                !$undorev->isDeleted( Revision::DELETED_TEXT ) &&
                                                !$oldrev->isDeleted( Revision::DELETED_TEXT ) ) {
 
@@ -1478,7 +1478,7 @@ class EditPage {
                $res = $dbw->select( 'revision',
                        'rev_user',
                        array(
-                               'rev_page' => $this->mTitle->getArticleId(),
+                               'rev_page' => $this->mTitle->getArticleID(),
                                'rev_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $edittime ) )
                        ),
                        __METHOD__,
index f155e6a..1147e6a 100644 (file)
@@ -1185,7 +1185,7 @@ class Revision {
                        $id = 0;
                }
                $conds = array( 'rev_id' => $id );
-               $conds['rev_page'] = $title->getArticleId();
+               $conds['rev_page'] = $title->getArticleID();
                $timestamp = $dbr->selectField( 'revision', 'rev_timestamp', $conds, __METHOD__ );
                if ( $timestamp === false && wfGetLB()->getServerCount() > 1 ) {
                        # Not in slave, try master
@@ -1219,7 +1219,7 @@ class Revision {
         * @return Integer
         */
        static function countByTitle( $db, $title ) {
-               $id = $title->getArticleId();
+               $id = $title->getArticleID();
                if( $id ) {
                        return Revision::countByPageId( $db, $id );
                }
index 7fc4a5c..eb2b8ae 100644 (file)
@@ -662,7 +662,7 @@ abstract class Skin extends ContextSource {
                $action = $this->getRequest()->getVal( 'action', 'view' );
 
                if ( $this->getUser()->isAllowed( 'deletedhistory' ) &&
-                       ( $this->getTitle()->getArticleId() == 0 || $action == 'history' ) ) {
+                       ( $this->getTitle()->getArticleID() == 0 || $action == 'history' ) ) {
                        $n = $this->getTitle()->isDeleted();
 
 
index 4db9da4..480f3eb 100644 (file)
@@ -324,7 +324,7 @@ class LegacyTemplate extends BaseTemplate {
 
                        $s = implode( $element, $sep );
 
-                       if ( $title->getArticleId() ) {
+                       if ( $title->getArticleID() ) {
                                $s .= "\n<br />";
 
                                // Delete/protect/move links for privileged users
@@ -573,7 +573,7 @@ class LegacyTemplate extends BaseTemplate {
                $diff = $wgRequest->getVal( 'diff' );
                $title = $this->getSkin()->getTitle();
 
-               if ( $title->getArticleId() && ( !$diff ) && $wgUser->isAllowed( 'delete' ) ) {
+               if ( $title->getArticleID() && ( !$diff ) && $wgUser->isAllowed( 'delete' ) ) {
                        $t = wfMsg( 'deletethispage' );
 
                        $s = Linker::linkKnown(
@@ -595,7 +595,7 @@ class LegacyTemplate extends BaseTemplate {
                $diff = $wgRequest->getVal( 'diff' );
                $title = $this->getSkin()->getTitle();
 
-               if ( $title->getArticleId() && ( ! $diff ) && $wgUser->isAllowed( 'protect' ) ) {
+               if ( $title->getArticleID() && ( ! $diff ) && $wgUser->isAllowed( 'protect' ) ) {
                        if ( $title->isProtected() ) {
                                $text = wfMsg( 'unprotectthispage' );
                                $query = array( 'action' => 'unprotect' );
index 2d198f9..d08b7ef 100644 (file)
@@ -216,7 +216,7 @@ class SkinTemplate extends Skin {
                $tpl->setRef( 'thispage', $this->thispage );
                $tpl->setRef( 'titleprefixeddbkey', $this->thispage );
                $tpl->set( 'titletext', $title->getText() );
-               $tpl->set( 'articleid', $title->getArticleId() );
+               $tpl->set( 'articleid', $title->getArticleID() );
 
                $tpl->set( 'isarticle', $out->isArticle() );
 
@@ -1173,7 +1173,7 @@ class SkinTemplate extends Skin {
                        $nav_urls['whatlinkshere'] = array(
                                'href' => SpecialPage::getTitleFor( 'Whatlinkshere', $this->thispage )->getLocalUrl()
                        );
-                       if ( $this->getTitle()->getArticleId() ) {
+                       if ( $this->getTitle()->getArticleID() ) {
                                $nav_urls['recentchangeslinked'] = array(
                                        'href' => SpecialPage::getTitleFor( 'Recentchangeslinked', $this->thispage )->getLocalUrl()
                                );
index 1a8f3e8..769adb9 100644 (file)
@@ -2538,7 +2538,7 @@ class Title {
 
                if ( $oldFashionedRestrictions === null ) {
                        $oldFashionedRestrictions = $dbr->selectField( 'page', 'page_restrictions',
-                               array( 'page_id' => $this->getArticleId() ), __METHOD__ );
+                               array( 'page_id' => $this->getArticleID() ), __METHOD__ );
                }
 
                if ( $oldFashionedRestrictions != '' ) {
@@ -2609,7 +2609,7 @@ class Title {
                                $res = $dbr->select(
                                        'page_restrictions',
                                        '*',
-                                       array( 'pr_page' => $this->getArticleId() ),
+                                       array( 'pr_page' => $this->getArticleID() ),
                                        __METHOD__
                                );
 
@@ -3167,7 +3167,7 @@ class Title {
         * @return Array of Title objects linking here
         */
        public function getLinksFrom( $options = array(), $table = 'pagelinks', $prefix = 'pl' ) {
-               $id = $this->getArticleId();
+               $id = $this->getArticleID();
 
                # If the page doesn't exist; there can't be any link from this page
                if ( !$id ) {
@@ -3231,7 +3231,7 @@ class Title {
         * @return Array of Title the Title objects
         */
        public function getBrokenLinksFrom() {
-               if ( $this->getArticleId() == 0 ) {
+               if ( $this->getArticleID() == 0 ) {
                        # All links from article ID 0 are false positives
                        return array();
                }
@@ -3241,7 +3241,7 @@ class Title {
                        array( 'page', 'pagelinks' ),
                        array( 'pl_namespace', 'pl_title' ),
                        array(
-                               'pl_from' => $this->getArticleId(),
+                               'pl_from' => $this->getArticleID(),
                                'page_namespace IS NULL'
                        ),
                        __METHOD__, array(),
@@ -3714,8 +3714,8 @@ class Title {
                        // We don't know whether this function was called before
                        // or after moving the root page, so check both
                        // $this and $nt
-                       if ( $oldSubpage->getArticleId() == $this->getArticleId() ||
-                                       $oldSubpage->getArticleID() == $nt->getArticleId() )
+                       if ( $oldSubpage->getArticleID() == $this->getArticleID() ||
+                                       $oldSubpage->getArticleID() == $nt->getArticleID() )
                        {
                                // When moving a page to a subpage of itself,
                                // don't move it twice
@@ -3839,7 +3839,7 @@ class Title {
 
                $data = array();
 
-               $titleKey = $this->getArticleId();
+               $titleKey = $this->getArticleID();
 
                if ( $titleKey === 0 ) {
                        return $data;
@@ -3917,7 +3917,7 @@ class Title {
                $db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
                return $db->selectField( 'revision', 'rev_id',
                        array(
-                               'rev_page' => $this->getArticleId( $flags ),
+                               'rev_page' => $this->getArticleID( $flags ),
                                'rev_id < ' . intval( $revId )
                        ),
                        __METHOD__,
@@ -3936,7 +3936,7 @@ class Title {
                $db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
                return $db->selectField( 'revision', 'rev_id',
                        array(
-                               'rev_page' => $this->getArticleId( $flags ),
+                               'rev_page' => $this->getArticleID( $flags ),
                                'rev_id > ' . intval( $revId )
                        ),
                        __METHOD__,
@@ -3951,7 +3951,7 @@ class Title {
         * @return Revision|Null if page doesn't exist
         */
        public function getFirstRevision( $flags = 0 ) {
-               $pageId = $this->getArticleId( $flags );
+               $pageId = $this->getArticleID( $flags );
                if ( $pageId ) {
                        $db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
                        $row = $db->selectRow( 'revision', '*',
@@ -4016,7 +4016,7 @@ class Title {
                if ( $this->mEstimateRevisions === null ) {
                        $dbr = wfGetDB( DB_SLAVE );
                        $this->mEstimateRevisions = $dbr->estimateRowCount( 'revision', '*',
-                               array( 'rev_page' => $this->getArticleId() ), __METHOD__ );
+                               array( 'rev_page' => $this->getArticleID() ), __METHOD__ );
                }
 
                return $this->mEstimateRevisions;
@@ -4043,7 +4043,7 @@ class Title {
                $dbr = wfGetDB( DB_SLAVE );
                return (int)$dbr->selectField( 'revision', 'count(*)',
                        array(
-                               'rev_page' => $this->getArticleId(),
+                               'rev_page' => $this->getArticleID(),
                                'rev_timestamp > ' . $dbr->addQuotes( $dbr->timestamp( $old->getTimestamp() ) ),
                                'rev_timestamp < ' . $dbr->addQuotes( $dbr->timestamp( $new->getTimestamp() ) )
                        ),
@@ -4117,7 +4117,7 @@ class Title {
         * @return Bool
         */
        public function exists() {
-               return $this->getArticleId() != 0;
+               return $this->getArticleID() != 0;
        }
 
        /**
index 04af1f1..6cad466 100644 (file)
@@ -2022,7 +2022,7 @@ class WikiPage extends Page {
 
                # Now that it's safely backed up, delete it
                $dbw->delete( 'page', array( 'page_id' => $id ), __METHOD__ );
-               $ok = ( $dbw->affectedRows() > 0 ); // getArticleId() uses slave, could be laggy
+               $ok = ( $dbw->affectedRows() > 0 ); // getArticleID() uses slave, could be laggy
 
                if ( !$ok ) {
                        $dbw->rollback( __METHOD__ );
index 70edabc..543beb7 100644 (file)
@@ -107,7 +107,7 @@ class InfoAction extends FormlessAction {
         * @return mixed array or boolean false
         */
        public static function pageCountInfo( $title ) {
-               $id = $title->getArticleId();
+               $id = $title->getArticleID();
                $dbr = wfGetDB( DB_SLAVE );
 
                $watchers = (int)$dbr->selectField(
index 17e8739..29fde03 100644 (file)
@@ -45,6 +45,11 @@ class LinkBatch {
                }
        }
 
+       /**
+        * @param $ns int
+        * @param $dbkey string
+        * @return mixed
+        */
        public function add( $ns, $dbkey ) {
                if ( $ns < 0 ) {
                        return;