From 9335469cf3cec23c459e9807ee739a67c56dacbb Mon Sep 17 00:00:00 2001 From: Reedy Date: Sat, 7 Nov 2015 21:10:23 +0000 Subject: [PATCH] Fix casing of function calls in API Change-Id: I44b343568e5713118c41f29a73e112162dd3e635 --- includes/api/ApiCreateAccount.php | 2 +- includes/api/ApiEditPage.php | 10 +++++----- includes/api/ApiFeedWatchlist.php | 2 +- includes/api/ApiFormatBase.php | 2 +- includes/api/ApiHelp.php | 2 +- includes/api/ApiMain.php | 6 +++--- includes/api/ApiOpenSearch.php | 6 +++--- includes/api/ApiParamInfo.php | 2 +- includes/api/ApiQueryBase.php | 8 ++++---- includes/api/ApiQueryCategoryMembers.php | 4 ++-- includes/api/ApiQueryImageInfo.php | 2 +- includes/api/ApiQueryInfo.php | 4 ++-- includes/api/ApiQueryRevisionsBase.php | 4 ++-- includes/api/ApiQuerySiteinfo.php | 2 +- includes/api/ApiSetNotificationTimestamp.php | 6 +++--- 15 files changed, 31 insertions(+), 31 deletions(-) diff --git a/includes/api/ApiCreateAccount.php b/includes/api/ApiCreateAccount.php index 00b7de9b6c..1368bda1fc 100644 --- a/includes/api/ApiCreateAccount.php +++ b/includes/api/ApiCreateAccount.php @@ -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, diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index 90d976a53e..78913e1daf 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -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(); diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index 0ddb3c3870..e8afcb67ce 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -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() ) { diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index 3c10518f51..17966afa0d 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -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 diff --git a/includes/api/ApiHelp.php b/includes/api/ApiHelp.php index e587162b9c..a8f1cd84d5 100644 --- a/includes/api/ApiHelp.php +++ b/includes/api/ApiHelp.php @@ -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', diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index e4ab7a5b38..27684096e8 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -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 diff --git a/includes/api/ApiOpenSearch.php b/includes/api/ApiOpenSearch.php index 0adb464d5a..f25f2d3833 100644 --- a/includes/api/ApiOpenSearch.php +++ b/includes/api/ApiOpenSearch.php @@ -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 ), ); } } diff --git a/includes/api/ApiParamInfo.php b/includes/api/ApiParamInfo.php index a9ddc6bb7f..63db63ef0d 100644 --- a/includes/api/ApiParamInfo.php +++ b/includes/api/ApiParamInfo.php @@ -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; diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index c4592c85f7..29fdfea679 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -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 ) ); } /** diff --git a/includes/api/ApiQueryCategoryMembers.php b/includes/api/ApiQueryCategoryMembers.php index af4042333e..35f76176c3 100644 --- a/includes/api/ApiQueryCategoryMembers.php +++ b/includes/api/ApiQueryCategoryMembers.php @@ -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' ); diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 736ac45e96..b23fbcfd26 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -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 ); } diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 7dcf23a4f7..6f1e2e5bc7 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -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__ ); diff --git a/includes/api/ApiQueryRevisionsBase.php b/includes/api/ApiQueryRevisionsBase.php index 0c5d5f302d..5bc1e795a0 100644 --- a/includes/api/ApiQueryRevisionsBase.php +++ b/includes/api/ApiQueryRevisionsBase.php @@ -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(); } diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 3d56128163..4f90e5f13d 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -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 ); } } diff --git a/includes/api/ApiSetNotificationTimestamp.php b/includes/api/ApiSetNotificationTimestamp.php index fa6fabf6f6..33f3bd8af9 100644 --- a/includes/api/ApiSetNotificationTimestamp.php +++ b/includes/api/ApiSetNotificationTimestamp.php @@ -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 ) { -- 2.20.1