r62406 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62405‎ | r62406 | r62407 >
Date:00:48, 13 February 2010
Author:reedy
Status:ok
Tags:
Comment:
Implement 9 modules dieUsage errors
Modified paths:
  • /trunk/phase3/includes/api/ApiQuery.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllimages.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllpages.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryCategories.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryExtLinksUsage.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryImageInfo.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryLogEvents.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQuerySiteinfo.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryWatchlistRaw.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php
@@ -484,7 +484,7 @@
485485
486486 public function getPossibleErrors() {
487487 return array_merge( parent::getPossibleErrors(), array(
488 - array( 'code' => 'includeAllDenied', 'info' => 'Cannot view all servers info unless $wgShowHostnames is true', ),
 488+ array( 'code' => 'includeAllDenied', 'info' => 'Cannot view all servers info unless $wgShowHostnames is true' ),
489489 ) );
490490 }
491491
Index: trunk/phase3/includes/api/ApiQueryExtLinksUsage.php
@@ -202,6 +202,12 @@
203203 public function getDescription() {
204204 return 'Enumerate pages that contain a given URL';
205205 }
 206+
 207+ public function getPossibleErrors() {
 208+ return array_merge( parent::getPossibleErrors(), array(
 209+ array( 'code' => 'bad_query', 'info' => 'Invalid query' ),
 210+ ) );
 211+ }
206212
207213 protected function getExamples() {
208214 return array (
Index: trunk/phase3/includes/api/ApiQueryAllpages.php
@@ -260,6 +260,13 @@
261261 public function getDescription() {
262262 return 'Enumerate all pages sequentially in a given namespace';
263263 }
 264+
 265+ public function getPossibleErrors() {
 266+ return array_merge( parent::getPossibleErrors(), array(
 267+ array( 'code' => 'params', 'info' => 'Use "gapfilterredir=nonredirects" option instead of "redirects" when using allpages as a generator' ),
 268+ array( 'code' => 'params', 'info' => 'prlevel may not be used without prtype' ),
 269+ ) );
 270+ }
264271
265272 protected function getExamples() {
266273 return array (
Index: trunk/phase3/includes/api/ApiQueryAllimages.php
@@ -192,6 +192,13 @@
193193 public function getDescription() {
194194 return 'Enumerate all images sequentially';
195195 }
 196+
 197+ public function getPossibleErrors() {
 198+ return array_merge( parent::getPossibleErrors(), array(
 199+ array( 'code' => 'params', 'info' => 'Use "gaifilterredir=nonredirects" option instead of "redirects" when using allimages as a generator' ),
 200+ array( 'code' => 'unsupportedrepo', 'info' => 'Local file repository does not support querying all images' ),
 201+ ) );
 202+ }
196203
197204 protected function getExamples() {
198205 return array (
Index: trunk/phase3/includes/api/ApiQueryLogEvents.php
@@ -284,8 +284,7 @@
285285
286286 return $vals;
287287 }
288 -
289 -
 288+
290289 public function getAllowedParams() {
291290 global $wgLogTypes;
292291 return array (
@@ -350,6 +349,13 @@
351350 public function getDescription() {
352351 return 'Get events from logs.';
353352 }
 353+
 354+ public function getPossibleErrors() {
 355+ return array_merge( parent::getPossibleErrors(), array(
 356+ array( 'code' => 'param_user', 'info' => 'User name $user not found' ),
 357+ array( 'code' => 'param_title', 'info' => 'Bad title value \'title\'' ),
 358+ ) );
 359+ }
354360
355361 protected function getExamples() {
356362 return array (
Index: trunk/phase3/includes/api/ApiQueryWatchlistRaw.php
@@ -170,6 +170,13 @@
171171 public function getDescription() {
172172 return "Get all pages on the logged in user's watchlist";
173173 }
 174+
 175+ public function getPossibleErrors() {
 176+ return array_merge( parent::getPossibleErrors(), array(
 177+ array( 'code' => 'notloggedin', 'info' => 'You must be logged-in to have a watchlist' ),
 178+ array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
 179+ ) );
 180+ }
174181
175182 protected function getExamples() {
176183 return array (
Index: trunk/phase3/includes/api/ApiQuery.php
@@ -561,6 +561,12 @@
562562 'All data modifications will first have to use query to acquire a token to prevent abuse from malicious sites.'
563563 );
564564 }
 565+
 566+ public function getPossibleErrors() {
 567+ return array_merge( parent::getPossibleErrors(), array(
 568+ array( 'code' => 'badgenerator', 'info' => 'Module $generatorName cannot be used as a generator' ),
 569+ ) );
 570+ }
565571
566572 protected function getExamples() {
567573 return array (
Index: trunk/phase3/includes/api/ApiQueryImageInfo.php
@@ -318,6 +318,12 @@
319319 return array (
320320 'Returns image information and upload history'
321321 );
 322+ }
 323+
 324+ public function getPossibleErrors() {
 325+ return array_merge( parent::getPossibleErrors(), array(
 326+ array( 'code' => 'iiurlwidth', 'info' => 'iiurlheight cannot be used without iiurlwidth' ),
 327+ ) );
322328 }
323329
324330 protected function getExamples() {
Index: trunk/phase3/includes/api/ApiQueryCategories.php
@@ -217,6 +217,12 @@
218218 public function getDescription() {
219219 return 'List all categories the page(s) belong to';
220220 }
 221+
 222+ public function getPossibleErrors() {
 223+ return array_merge( parent::getPossibleErrors(), array(
 224+ array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
 225+ ) );
 226+ }
221227
222228 protected function getExamples() {
223229 return array (

Status & tagging log