X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=blobdiff_plain;f=includes%2Fapi%2FApiTokens.php;h=073495c0706427b19f1c21955b858f9322922864;hb=aa21e125a34e8ca44e05d5dd96bb28562ec8e347;hp=e5e9d5d4c9809794a04a77a2682a0c0eaeee172b;hpb=5c871fd8a86676cf3238df064de9e85f25191876;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiTokens.php b/includes/api/ApiTokens.php index e5e9d5d4c9..073495c070 100644 --- a/includes/api/ApiTokens.php +++ b/includes/api/ApiTokens.php @@ -63,16 +63,14 @@ class ApiTokens extends ApiBase { if ( $types ) { return $types; } - wfProfileIn( __METHOD__ ); $types = array( 'patrol' => array( 'ApiQueryRecentChanges', 'getPatrolToken' ) ); $names = array( 'edit', 'delete', 'protect', 'move', 'block', 'unblock', 'email', 'import', 'watch', 'options' ); foreach ( $names as $name ) { $types[$name] = array( 'ApiQueryInfo', 'get' . ucfirst( $name ) . 'Token' ); } - wfRunHooks( 'ApiTokensGetTokenTypes', array( &$types ) ); + Hooks::run( 'ApiTokensGetTokenTypes', array( &$types ) ); ksort( $types ); - wfProfileOut( __METHOD__ ); return $types; } @@ -91,23 +89,12 @@ class ApiTokens extends ApiBase { ); } - public function getParamDescription() { + protected function getExamplesMessages() { return array( - 'type' => 'Type of token(s) to request' - ); - } - - public function getDescription() { - return array( - 'This module is deprecated in favor of action=query&meta=tokens.', - 'Gets tokens for data-modifying actions.' - ); - } - - protected function getExamples() { - return array( - 'api.php?action=tokens' => 'Retrieve an edit token (the default)', - 'api.php?action=tokens&type=email|move' => 'Retrieve an email token and a move token' + 'action=tokens' + => 'apihelp-tokens-example-edit', + 'action=tokens&type=email|move' + => 'apihelp-tokens-example-emailmove', ); } }