From: Sam Reed Date: Sat, 13 Feb 2010 00:48:31 +0000 (+0000) Subject: Implement 9 modules dieUsage errors X-Git-Tag: 1.31.0-rc.0~37793 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=1f9a7d791c93f9581b46c5ab299a496cf8ba84a5;p=lhc%2Fweb%2Fwiklou.git Implement 9 modules dieUsage errors --- diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index 75d0f89f2a..38f79aac51 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -561,6 +561,12 @@ class ApiQuery extends ApiBase { 'All data modifications will first have to use query to acquire a token to prevent abuse from malicious sites.' ); } + + public function getPossibleErrors() { + return array_merge( parent::getPossibleErrors(), array( + array( 'code' => 'badgenerator', 'info' => 'Module $generatorName cannot be used as a generator' ), + ) ); + } protected function getExamples() { return array ( diff --git a/includes/api/ApiQueryAllimages.php b/includes/api/ApiQueryAllimages.php index c113049848..363a65c362 100644 --- a/includes/api/ApiQueryAllimages.php +++ b/includes/api/ApiQueryAllimages.php @@ -192,6 +192,13 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase { public function getDescription() { return 'Enumerate all images sequentially'; } + + public function getPossibleErrors() { + return array_merge( parent::getPossibleErrors(), array( + array( 'code' => 'params', 'info' => 'Use "gaifilterredir=nonredirects" option instead of "redirects" when using allimages as a generator' ), + array( 'code' => 'unsupportedrepo', 'info' => 'Local file repository does not support querying all images' ), + ) ); + } protected function getExamples() { return array ( diff --git a/includes/api/ApiQueryAllpages.php b/includes/api/ApiQueryAllpages.php index 42055b0e42..a8573d828b 100644 --- a/includes/api/ApiQueryAllpages.php +++ b/includes/api/ApiQueryAllpages.php @@ -260,6 +260,13 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase { public function getDescription() { return 'Enumerate all pages sequentially in a given namespace'; } + + public function getPossibleErrors() { + return array_merge( parent::getPossibleErrors(), array( + array( 'code' => 'params', 'info' => 'Use "gapfilterredir=nonredirects" option instead of "redirects" when using allpages as a generator' ), + array( 'code' => 'params', 'info' => 'prlevel may not be used without prtype' ), + ) ); + } protected function getExamples() { return array ( diff --git a/includes/api/ApiQueryCategories.php b/includes/api/ApiQueryCategories.php index d45895df58..bf71ca62b8 100644 --- a/includes/api/ApiQueryCategories.php +++ b/includes/api/ApiQueryCategories.php @@ -217,6 +217,12 @@ class ApiQueryCategories extends ApiQueryGeneratorBase { public function getDescription() { return 'List all categories the page(s) belong to'; } + + public function getPossibleErrors() { + return array_merge( parent::getPossibleErrors(), array( + array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ), + ) ); + } protected function getExamples() { return array ( diff --git a/includes/api/ApiQueryExtLinksUsage.php b/includes/api/ApiQueryExtLinksUsage.php index 42614ad284..c4d43d5de1 100644 --- a/includes/api/ApiQueryExtLinksUsage.php +++ b/includes/api/ApiQueryExtLinksUsage.php @@ -202,6 +202,12 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase { public function getDescription() { return 'Enumerate pages that contain a given URL'; } + + public function getPossibleErrors() { + return array_merge( parent::getPossibleErrors(), array( + array( 'code' => 'bad_query', 'info' => 'Invalid query' ), + ) ); + } protected function getExamples() { return array ( diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 30da6b0628..e52d141078 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -318,6 +318,12 @@ class ApiQueryImageInfo extends ApiQueryBase { return array ( 'Returns image information and upload history' ); + } + + public function getPossibleErrors() { + return array_merge( parent::getPossibleErrors(), array( + array( 'code' => 'iiurlwidth', 'info' => 'iiurlheight cannot be used without iiurlwidth' ), + ) ); } protected function getExamples() { diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index d6672b21d9..fdc6f4add8 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -284,8 +284,7 @@ class ApiQueryLogEvents extends ApiQueryBase { return $vals; } - - + public function getAllowedParams() { global $wgLogTypes; return array ( @@ -350,6 +349,13 @@ class ApiQueryLogEvents extends ApiQueryBase { public function getDescription() { return 'Get events from logs.'; } + + public function getPossibleErrors() { + return array_merge( parent::getPossibleErrors(), array( + array( 'code' => 'param_user', 'info' => 'User name $user not found' ), + array( 'code' => 'param_title', 'info' => 'Bad title value \'title\'' ), + ) ); + } protected function getExamples() { return array ( diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 0d35742921..1e42f4009f 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -484,7 +484,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { public function getPossibleErrors() { return array_merge( parent::getPossibleErrors(), array( - array( 'code' => 'includeAllDenied', 'info' => 'Cannot view all servers info unless $wgShowHostnames is true', ), + array( 'code' => 'includeAllDenied', 'info' => 'Cannot view all servers info unless $wgShowHostnames is true' ), ) ); } diff --git a/includes/api/ApiQueryWatchlistRaw.php b/includes/api/ApiQueryWatchlistRaw.php index ab0957268b..ff9b357c2a 100644 --- a/includes/api/ApiQueryWatchlistRaw.php +++ b/includes/api/ApiQueryWatchlistRaw.php @@ -170,6 +170,13 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase { public function getDescription() { return "Get all pages on the logged in user's watchlist"; } + + public function getPossibleErrors() { + return array_merge( parent::getPossibleErrors(), array( + array( 'code' => 'notloggedin', 'info' => 'You must be logged-in to have a watchlist' ), + array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ), + ) ); + } protected function getExamples() { return array (