From: Sam Reed Date: Thu, 27 Oct 2011 00:46:17 +0000 (+0000) Subject: Documentation X-Git-Tag: 1.31.0-rc.0~26892 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=fa65fa3243c65e5a0a9debdc12a1dc8524b3d657;p=lhc%2Fweb%2Fwiklou.git Documentation Deprecated code updates --- diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 861da5ba58..e0167d997b 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -436,6 +436,7 @@ abstract class ApiBase extends ContextSource { * Callback for preg_replace_callback() call in makeHelpMsg(). * Replaces a source file name with a link to ViewVC * + * @param $matches array * @return string */ public function makeHelpMsg_callback( $matches ) { diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php index 65001d6f27..56c6289581 100644 --- a/includes/api/ApiBlock.php +++ b/includes/api/ApiBlock.php @@ -52,7 +52,7 @@ class ApiBlock extends ApiBase { $params = $this->extractRequestParams(); if ( $params['gettoken'] ) { - $res['blocktoken'] = $user->editToken( '', $this->getMain()->getRequest() ); + $res['blocktoken'] = $user->getEditToken( '', $this->getMain()->getRequest() ); $this->getResult()->addValue( null, $this->getModuleName(), $res ); return; } diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index de324e4dcd..83cf6f0c93 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -98,20 +98,15 @@ class ApiDelete extends ApiBase { } /** - * - * @param &$title Title + * @param $title Title * @param $token String + * @return array */ private static function getPermissionsError( &$title, $token ) { global $wgUser; // Check permissions - $errors = $title->getUserPermissionsErrors( 'delete', $wgUser ); - if ( count( $errors ) > 0 ) { - return $errors; - } - - return array(); + return $title->getUserPermissionsErrors( 'delete', $wgUser ); } /** diff --git a/includes/api/ApiFeedContributions.php b/includes/api/ApiFeedContributions.php index 66559c2367..e2b690064a 100644 --- a/includes/api/ApiFeedContributions.php +++ b/includes/api/ApiFeedContributions.php @@ -1,5 +1,4 @@ complete documentation, or public function getBuffer() { return $this->mBuffer; } + /** * Set the flag to buffer the result instead of printing it. + * @param $value bool */ public function setBufferResult( $value ) { $this->mBufferResult = $value; @@ -335,6 +337,8 @@ class ApiFormatFeedWrapper extends ApiFormatBase { /** * Feed does its own headers + * + * @return null */ public function getMimeType() { return null; diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 1c80b278f1..cfc2fb208a 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -390,6 +390,8 @@ class ApiParse extends ApiBase { /** * @deprecated since 1.18 No modern skin generates language links this way, please use language links * data to generate your own HTML. + * @param $languages array + * @return string */ private function languagesHtml( $languages ) { global $wgContLang, $wgHideInterlanguageLinks; diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index 62ae9e30b1..546e0817e0 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -132,7 +132,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase { if ( $fld_token ) { // Undelete tokens are identical for all pages, so we cache one here - $token = $user->editToken( '', $this->getMain()->getRequest() ); + $token = $user->getEditToken( '', $this->getMain()->getRequest() ); } $dir = $params['dir']; diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index b56775c44a..fe98bb31b0 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -119,7 +119,7 @@ class ApiQueryInfo extends ApiQueryBase { return $cachedEditToken; } - $cachedEditToken = $wgUser->editToken(); + $cachedEditToken = $wgUser->getEditToken(); return $cachedEditToken; } @@ -134,7 +134,7 @@ class ApiQueryInfo extends ApiQueryBase { return $cachedDeleteToken; } - $cachedDeleteToken = $wgUser->editToken(); + $cachedDeleteToken = $wgUser->getEditToken(); return $cachedDeleteToken; } @@ -149,7 +149,7 @@ class ApiQueryInfo extends ApiQueryBase { return $cachedProtectToken; } - $cachedProtectToken = $wgUser->editToken(); + $cachedProtectToken = $wgUser->getEditToken(); return $cachedProtectToken; } @@ -164,7 +164,7 @@ class ApiQueryInfo extends ApiQueryBase { return $cachedMoveToken; } - $cachedMoveToken = $wgUser->editToken(); + $cachedMoveToken = $wgUser->getEditToken(); return $cachedMoveToken; } @@ -179,7 +179,7 @@ class ApiQueryInfo extends ApiQueryBase { return $cachedBlockToken; } - $cachedBlockToken = $wgUser->editToken(); + $cachedBlockToken = $wgUser->getEditToken(); return $cachedBlockToken; } @@ -199,7 +199,7 @@ class ApiQueryInfo extends ApiQueryBase { return $cachedEmailToken; } - $cachedEmailToken = $wgUser->editToken(); + $cachedEmailToken = $wgUser->getEditToken(); return $cachedEmailToken; } @@ -214,7 +214,7 @@ class ApiQueryInfo extends ApiQueryBase { return $cachedImportToken; } - $cachedImportToken = $wgUser->editToken(); + $cachedImportToken = $wgUser->getEditToken(); return $cachedImportToken; } @@ -229,7 +229,7 @@ class ApiQueryInfo extends ApiQueryBase { return $cachedWatchToken; } - $cachedWatchToken = $wgUser->editToken( 'watch' ); + $cachedWatchToken = $wgUser->getEditToken( 'watch' ); return $cachedWatchToken; } diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 9bcbefb7e4..7d62f33f48 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -52,7 +52,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { * Get an array mapping token names to their handler functions. * The prototype for a token function is func($pageid, $title, $rc) * it should return a token or false (permission denied) - * @return array(tokenname => function) + * @return array array(tokenname => function) */ protected function getTokenFunctions() { // Don't call the hooks twice @@ -89,7 +89,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { // The patrol token is always the same, let's exploit that static $cachedPatrolToken = null; if ( is_null( $cachedPatrolToken ) ) { - $cachedPatrolToken = $wgUser->editToken( 'patrol' ); + $cachedPatrolToken = $wgUser->getEditToken( 'patrol' ); } return $cachedPatrolToken; diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 018449acef..807b201567 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -84,8 +84,8 @@ class ApiQueryRevisions extends ApiQueryBase { if ( !$wgUser->isAllowed( 'rollback' ) ) { return false; } - return $wgUser->editToken( array( $title->getPrefixedText(), - $rev->getUserText() ) ); + return $wgUser->getEditToken( + array( $title->getPrefixedText(), $rev->getUserText() ) ); } public function execute() { diff --git a/includes/api/ApiQueryUserInfo.php b/includes/api/ApiQueryUserInfo.php index 5fd9bb135c..ca1dfb6d47 100644 --- a/includes/api/ApiQueryUserInfo.php +++ b/includes/api/ApiQueryUserInfo.php @@ -110,7 +110,7 @@ class ApiQueryUserInfo extends ApiQueryBase { if ( isset( $this->prop['preferencestoken'] ) && is_null( $this->getMain()->getRequest()->getVal( 'callback' ) ) ) { - $vals['preferencestoken'] = $user->editToken( '', $this->getMain()->getRequest() ); + $vals['preferencestoken'] = $user->getEditToken( '', $this->getMain()->getRequest() ); } if ( isset( $this->prop['editcount'] ) ) { diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php index a76bfede5e..76f815c442 100644 --- a/includes/api/ApiQueryUsers.php +++ b/includes/api/ApiQueryUsers.php @@ -74,7 +74,7 @@ class ApiQueryUsers extends ApiQueryBase { global $wgUser; // Since the permissions check for userrights is non-trivial, // don't bother with it here - return $wgUser->editToken( $user->getName() ); + return $wgUser->getEditToken( $user->getName() ); } public function execute() { diff --git a/includes/api/ApiUnblock.php b/includes/api/ApiUnblock.php index a2921bdd7c..41157271c6 100644 --- a/includes/api/ApiUnblock.php +++ b/includes/api/ApiUnblock.php @@ -49,7 +49,7 @@ class ApiUnblock extends ApiBase { $params = $this->extractRequestParams(); if ( $params['gettoken'] ) { - $res['unblocktoken'] = $user->editToken( '', $this->getMain()->getRequest() ); + $res['unblocktoken'] = $user->getEditToken( '', $this->getMain()->getRequest() ); $this->getResult()->addValue( null, $this->getModuleName(), $res ); return; }