r70756 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70755‎ | r70756 | r70757 >
Date:08:09, 9 August 2010
Author:jeroendedauw
Status:deferred (Comments)
Tags:
Comment:
Added parameter definitions in the API module
Modified paths:
  • /trunk/extensions/Distribution/api/ApiQueryExtensions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Distribution/api/ApiQueryExtensions.php
@@ -50,6 +50,14 @@
5151 */
5252 public function getAllowedParams() {
5353 return array (
 54+ 'limit' => array(
 55+ ApiBase :: PARAM_DFLT => 10,
 56+ ApiBase :: PARAM_TYPE => 'limit',
 57+ ApiBase :: PARAM_MIN => 1,
 58+ ApiBase :: PARAM_MAX => ApiBase :: LIMIT_BIG1,
 59+ ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2
 60+ ),
 61+ 'continue' => null,
5462 );
5563 }
5664
@@ -60,6 +68,8 @@
6169 */
6270 public function getParamDescription() {
6371 return array (
 72+ 'continue' => 'Number of the first story to return',
 73+ 'limit' => 'Amount of stories to return',
6474 );
6575 }
6676
@@ -69,7 +79,7 @@
7080 * @since 0.1
7181 */
7282 public function getDescription() {
73 - return '';
 83+ return 'Provides release information about MediaWiki extensions and packages.';
7484 }
7585
7686 /**
@@ -89,6 +99,8 @@
90100 */
91101 protected function getExamples() {
92102 return array (
 103+ 'api.php?action=query&list=extensions',
 104+ 'api.php?action=query&list=extensions&dstlimit=42',
93105 );
94106 }
95107

Follow-up revisions

RevisionCommit summaryAuthorDate
r70787Follow up to r70756jeroendedauw00:51, 10 August 2010

Comments

#Comment by Reedy (talk | contribs)   11:50, 9 August 2010

AFAIK we don't use spaces in designation of static things..

Use ApiBase::PARAM_DFLT

rather than

ApiBase :: PARAM_DFLT


I'd guess...

+			'continue' => 'Number of the first story to return',
+			'limit'   => 'Amount of stories to return',		

are just copy paste fails? :)

#Comment by Werdna (talk | contribs)   11:51, 9 August 2010

The spaces are a weird API convention.

#Comment by Catrope (talk | contribs)   11:59, 9 August 2010

...which was killed by a stylize.php run. They were only there because that's how Yuri liked to write his code back in 2006.

#Comment by Jeroen De Dauw (talk | contribs)   00:52, 10 August 2010

Both issues fixed in follow up

Status & tagging log