Fix casing of function calls in API
authorReedy <reedy@wikimedia.org>
Sat, 7 Nov 2015 21:10:23 +0000 (21:10 +0000)
committerReedy <reedy@wikimedia.org>
Sat, 7 Nov 2015 21:10:23 +0000 (21:10 +0000)
Change-Id: I44b343568e5713118c41f29a73e112162dd3e635

15 files changed:
includes/api/ApiCreateAccount.php
includes/api/ApiEditPage.php
includes/api/ApiFeedWatchlist.php
includes/api/ApiFormatBase.php
includes/api/ApiHelp.php
includes/api/ApiMain.php
includes/api/ApiOpenSearch.php
includes/api/ApiParamInfo.php
includes/api/ApiQueryBase.php
includes/api/ApiQueryCategoryMembers.php
includes/api/ApiQueryImageInfo.php
includes/api/ApiQueryInfo.php
includes/api/ApiQueryRevisionsBase.php
includes/api/ApiQuerySiteinfo.php
includes/api/ApiSetNotificationTimestamp.php

index 00b7de9..1368bda 100644 (file)
@@ -95,7 +95,7 @@ class ApiCreateAccount extends ApiBase {
                Hooks::run( 'AddNewAccountApiForm', array( $this, $loginForm ) );
                $loginForm->load();
 
-               $status = $loginForm->addNewaccountInternal();
+               $status = $loginForm->addNewAccountInternal();
                LoggerFactory::getInstance( 'authmanager' )->info( 'Account creation attempt via API', array(
                        'event' => 'accountcreation',
                        'status' => $status,
index 90d976a..78913e1 100644 (file)
@@ -244,12 +244,12 @@ class ApiEditPage extends ApiBase {
                                $this->dieUsageMsg( array( 'nosuchrevid', $params['undoafter'] ) );
                        }
 
-                       if ( $undoRev->getPage() != $pageObj->getID() ) {
-                               $this->dieUsageMsg( array( 'revwrongpage', $undoRev->getID(),
+                       if ( $undoRev->getPage() != $pageObj->getId() ) {
+                               $this->dieUsageMsg( array( 'revwrongpage', $undoRev->getId(),
                                        $titleObj->getPrefixedText() ) );
                        }
-                       if ( $undoafterRev->getPage() != $pageObj->getID() ) {
-                               $this->dieUsageMsg( array( 'revwrongpage', $undoafterRev->getID(),
+                       if ( $undoafterRev->getPage() != $pageObj->getId() ) {
+                               $this->dieUsageMsg( array( 'revwrongpage', $undoafterRev->getId(),
                                        $titleObj->getPrefixedText() ) );
                        }
 
@@ -268,7 +268,7 @@ class ApiEditPage extends ApiBase {
                        // If no summary was given and we only undid one rev,
                        // use an autosummary
                        if ( is_null( $params['summary'] ) &&
-                               $titleObj->getNextRevisionID( $undoafterRev->getID() ) == $params['undo']
+                               $titleObj->getNextRevisionID( $undoafterRev->getId() ) == $params['undo']
                        ) {
                                $params['summary'] = wfMessage( 'undo-summary' )
                                        ->params( $params['undo'], $undoRev->getUserText() )->inContentLanguage()->text();
index 0ddb3c3..e8afcb6 100644 (file)
@@ -181,7 +181,7 @@ class ApiFeedWatchlist extends ApiBase {
                        // Probably a formerly-valid title that's now conflicting with an
                        // interwiki prefix or the like.
                        if ( isset( $info['pageid'] ) ) {
-                               $title = Title::newFromId( $info['pageid'] );
+                               $title = Title::newFromID( $info['pageid'] );
                                $curidParam = array( 'curid' => $info['pageid'] );
                        }
                        if ( !$title || $title->isExternal() ) {
index 3c10518..17966af 100644 (file)
@@ -207,7 +207,7 @@ abstract class ApiFormatBase extends ApiBase {
 
                        // API handles its own clickjacking protection.
                        // Note, that $wgBreakFrames will still override $wgApiFrameOptions for format mode.
-                       $out->allowClickJacking();
+                       $out->allowClickjacking();
                        $out->output();
                } else {
                        // For non-HTML output, clear all errors that might have been
index e587162..a8f1cd8 100644 (file)
@@ -180,7 +180,7 @@ class ApiHelp extends ApiBase {
                                        $href = $m[2] === '' ? '#' . $m[1] : $m[2];
                                } elseif ( $helptitle !== null ) {
                                        $href = Title::newFromText( str_replace( '$1', $m[1], $helptitle ) . $m[2] )
-                                               ->getFullUrl();
+                                               ->getFullURL();
                                } else {
                                        $href = wfAppendQuery( wfScript( 'api' ), array(
                                                'action' => 'help',
index e4ab7a5..2768409 100644 (file)
@@ -895,7 +895,7 @@ class ApiMain extends ApiBase {
                }
                if ( $config->get( 'ShowHostnames' ) ) {
                        // servedby is especially useful when debugging errors
-                       $result->addValue( null, 'servedby', wfHostName(), ApiResult::NO_SIZE_CHECK );
+                       $result->addValue( null, 'servedby', wfHostname(), ApiResult::NO_SIZE_CHECK );
                }
                if ( $warnings !== null ) {
                        $result->addValue( null, 'warnings', $warnings, ApiResult::NO_SIZE_CHECK );
@@ -1535,7 +1535,7 @@ class ApiMain extends ApiBase {
                        $tocnumber = &$options['tocnumber'];
 
                        $header = $this->msg( 'api-help-datatypes-header' )->parse();
-                       $help['datatypes'] .= Html::rawelement( 'h' . min( 6, $level ),
+                       $help['datatypes'] .= Html::rawElement( 'h' . min( 6, $level ),
                                array( 'id' => 'main/datatypes', 'class' => 'apihelp-header' ),
                                Html::element( 'span', array( 'id' => Sanitizer::escapeId( 'main/datatypes' ) ) ) .
                                $header
@@ -1554,7 +1554,7 @@ class ApiMain extends ApiBase {
                        }
 
                        $header = $this->msg( 'api-credits-header' )->parse();
-                       $help['credits'] .= Html::rawelement( 'h' . min( 6, $level ),
+                       $help['credits'] .= Html::rawElement( 'h' . min( 6, $level ),
                                array( 'id' => 'main/credits', 'class' => 'apihelp-header' ),
                                Html::element( 'span', array( 'id' => Sanitizer::escapeId( 'main/credits' ) ) ) .
                                $header
index 0adb464..f25f2d3 100644 (file)
@@ -140,7 +140,7 @@ class ApiOpenSearch extends ApiBase {
                        $redirects = array();
                        $lb = new LinkBatch( $titles );
                        if ( !$lb->isEmpty() ) {
-                               $db = $this->getDb();
+                               $db = $this->getDB();
                                $res = $db->select(
                                        array( 'page', 'redirect' ),
                                        array( 'page_namespace', 'page_title', 'rd_namespace', 'rd_title' ),
@@ -170,7 +170,7 @@ class ApiOpenSearch extends ApiBase {
                                }
                                if ( !isset( $seen[$ns][$dbkey] ) ) {
                                        $seen[$ns][$dbkey] = true;
-                                       $resultId = $title->getArticleId();
+                                       $resultId = $title->getArticleID();
                                        if ( $resultId === 0 ) {
                                                $resultId = $nextSpecialPageId;
                                                $nextSpecialPageId -= 1;
@@ -181,7 +181,7 @@ class ApiOpenSearch extends ApiBase {
                                                'extract' => false,
                                                'extract trimmed' => false,
                                                'image' => false,
-                                               'url' => wfExpandUrl( $title->getFullUrl(), PROTO_CURRENT ),
+                                               'url' => wfExpandUrl( $title->getFullURL(), PROTO_CURRENT ),
                                        );
                                }
                        }
index a9ddc6b..63db63e 100644 (file)
@@ -200,7 +200,7 @@ class ApiParamInfo extends ApiBase {
                                $ret['sourcename'] = $ret['source'];
                        }
 
-                       $link = SpecialPage::getTitleFor( 'Version', 'License/' . $sourceInfo['name'] )->getFullUrl();
+                       $link = SpecialPage::getTitleFor( 'Version', 'License/' . $sourceInfo['name'] )->getFullURL();
                        if ( isset( $sourceInfo['license-name'] ) ) {
                                $ret['licensetag'] = $sourceInfo['license-name'];
                                $ret['licenselink'] = (string)$link;
index c4592c8..29fdfea 100644 (file)
@@ -317,7 +317,7 @@ abstract class ApiQueryBase extends ApiBase {
         * @param bool $sort
         */
        protected function addTimestampWhereRange( $field, $dir, $start, $end, $sort = true ) {
-               $db = $this->getDb();
+               $db = $this->getDB();
                $this->addWhereRange( $field, $dir,
                        $db->timestampOrNull( $start ), $db->timestampOrNull( $end ), $sort );
        }
@@ -384,7 +384,7 @@ abstract class ApiQueryBase extends ApiBase {
         * @return null|string
         */
        public function prepareUrlQuerySearchString( $query = null, $protocol = null ) {
-               $db = $this->getDb();
+               $db = $this->getDB();
                if ( !is_null( $query ) || $query != '' ) {
                        if ( is_null( $protocol ) ) {
                                $protocol = 'http://';
@@ -529,7 +529,7 @@ abstract class ApiQueryBase extends ApiBase {
                        $this->dieUsageMsg( array( 'invalidtitle', $titlePart ) );
                }
 
-               return substr( $t->getDbKey(), 0, -1 );
+               return substr( $t->getDBkey(), 0, -1 );
        }
 
        /**
@@ -547,7 +547,7 @@ abstract class ApiQueryBase extends ApiBase {
                        $this->dieUsageMsg( array( 'invalidtitle', $titlePart ) );
                }
 
-               return array( $t->getNamespace(), substr( $t->getDbKey(), 0, -1 ) );
+               return array( $t->getNamespace(), substr( $t->getDBkey(), 0, -1 ) );
        }
 
        /**
index af40423..35f7617 100644 (file)
@@ -151,7 +151,7 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
                                $this->addWhereRange( 'cl_from', $dir, null, null );
                        } else {
                                if ( $params['startsortkeyprefix'] !== null ) {
-                                       $startsortkey = Collation::singleton()->getSortkey( $params['startsortkeyprefix'] );
+                                       $startsortkey = Collation::singleton()->getSortKey( $params['startsortkeyprefix'] );
                                } elseif ( $params['starthexsortkey'] !== null ) {
                                        if ( !$this->validateHexSortkey( $params['starthexsortkey'] ) ) {
                                                $this->dieUsage( 'The starthexsortkey provided is not valid', 'bad_starthexsortkey' );
@@ -161,7 +161,7 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
                                        $startsortkey = $params['startsortkey'];
                                }
                                if ( $params['endsortkeyprefix'] !== null ) {
-                                       $endsortkey = Collation::singleton()->getSortkey( $params['endsortkeyprefix'] );
+                                       $endsortkey = Collation::singleton()->getSortKey( $params['endsortkeyprefix'] );
                                } elseif ( $params['endhexsortkey'] !== null ) {
                                        if ( !$this->validateHexSortkey( $params['endhexsortkey'] ) ) {
                                                $this->dieUsage( 'The endhexsortkey provided is not valid', 'bad_endhexsortkey' );
index 736ac45..b23fbcf 100644 (file)
@@ -515,7 +515,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                                        $vals['thumberror'] = $mto->toText();
                                }
                        }
-                       $vals['url'] = wfExpandUrl( $file->getFullURL(), PROTO_CURRENT );
+                       $vals['url'] = wfExpandUrl( $file->getFullUrl(), PROTO_CURRENT );
                        $vals['descriptionurl'] = wfExpandUrl( $file->getDescriptionUrl(), PROTO_CURRENT );
                }
 
index 7dcf23a..6f1e2e5 100644 (file)
@@ -222,7 +222,7 @@ class ApiQueryInfo extends ApiQueryBase {
         */
        public static function getEmailToken( $pageid, $title ) {
                global $wgUser;
-               if ( !$wgUser->canSendEmail() || $wgUser->isBlockedFromEmailUser() ) {
+               if ( !$wgUser->canSendEmail() || $wgUser->isBlockedFromEmailuser() ) {
                        return false;
                }
 
@@ -747,7 +747,7 @@ class ApiQueryInfo extends ApiQueryBase {
                $this->addFieldsIf( 'wl_notificationtimestamp', $this->fld_notificationtimestamp );
                $this->addWhere( array(
                        $lb->constructSet( 'wl', $db ),
-                       'wl_user' => $user->getID()
+                       'wl_user' => $user->getId()
                ) );
 
                $res = $this->select( __METHOD__ );
index 0c5d5f3..5bc1e79 100644 (file)
@@ -84,7 +84,7 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
                                        $this->dieUsageMsg( array( 'nosuchrevid', $params['diffto'] ) );
                                }
                                if ( !$difftoRev->userCan( Revision::DELETED_TEXT, $this->getUser() ) ) {
-                                       $this->setWarning( "Couldn't diff to r{$difftoRev->getID()}: content is hidden" );
+                                       $this->setWarning( "Couldn't diff to r{$difftoRev->getId()}: content is hidden" );
                                        $params['diffto'] = null;
                                }
                        }
@@ -392,7 +392,7 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
                                                $engine->setContent( $content, $difftocontent );
                                        }
                                } else {
-                                       $engine = $handler->createDifferenceEngine( $context, $revision->getID(), $this->diffto );
+                                       $engine = $handler->createDifferenceEngine( $context, $revision->getId(), $this->diffto );
                                        $vals['diff']['from'] = $engine->getOldid();
                                        $vals['diff']['to'] = $engine->getNewid();
                                }
index 3d56128..4f90e5f 100644 (file)
@@ -497,7 +497,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                                        $arr['number'] = SiteStats::users();
                                // '*' and autopromote groups have no size
                                } elseif ( $group !== '*' && !isset( $autopromote[$group] ) ) {
-                                       $arr['number'] = SiteStats::numberInGroup( $group );
+                                       $arr['number'] = SiteStats::numberingroup( $group );
                                }
                        }
 
index fa6fabf..33f3bd8 100644 (file)
@@ -103,7 +103,7 @@ class ApiSetNotificationTimestamp extends ApiBase {
                if ( $params['entirewatchlist'] ) {
                        // Entire watchlist mode: Just update the thing and return a success indicator
                        $dbw->update( 'watchlist', array( 'wl_notificationtimestamp' => $timestamp ),
-                               array( 'wl_user' => $user->getID() ),
+                               array( 'wl_user' => $user->getId() ),
                                __METHOD__
                        );
 
@@ -135,7 +135,7 @@ class ApiSetNotificationTimestamp extends ApiBase {
                                // Now process the valid titles
                                $lb = new LinkBatch( $pageSet->getTitles() );
                                $dbw->update( 'watchlist', array( 'wl_notificationtimestamp' => $timestamp ),
-                                       array( 'wl_user' => $user->getID(), $lb->constructSet( 'wl', $dbw ) ),
+                                       array( 'wl_user' => $user->getId(), $lb->constructSet( 'wl', $dbw ) ),
                                        __METHOD__
                                );
 
@@ -144,7 +144,7 @@ class ApiSetNotificationTimestamp extends ApiBase {
                                $res = $dbw->select(
                                        'watchlist',
                                        array( 'wl_namespace', 'wl_title', 'wl_notificationtimestamp' ),
-                                       array( 'wl_user' => $user->getID(), $lb->constructSet( 'wl', $dbw ) ),
+                                       array( 'wl_user' => $user->getId(), $lb->constructSet( 'wl', $dbw ) ),
                                        __METHOD__
                                );
                                foreach ( $res as $row ) {