* (bug 33224) add variants of content language to meta=siteinfo
* (bug 36761) "Mark pages as visited" now submits previously established filter options
* (bug 32643) action=purge with forcelinkupdate no longer crashes when ratelimit is reached
+* The paraminfo module now also contains result properties for most modules
=== Languages updated in 1.20 ===
&$module: ApiBase Module object
&$desc: Array of parameter descriptions
+'APIGetResultProperties': use this hook to mofify the properties
+in a module's result.
+&$module: ApiBase Module object
+&$properties: Array of properties
+
'APIQueryAfterExecute': after calling the execute() method of an
action=query submodule. Use this to extend core API modules.
&$module: Module object
/// @since 1.17
const PARAM_RANGE_ENFORCE = 9; // Boolean, if MIN/MAX are set, enforce (die) these? Only applies if TYPE='integer' Use with extreme caution
+ const PROP_ROOT = 'ROOT'; // Name of property group that is on the root element of the result, i.e. not part of a list
+ const PROP_LIST = 'LIST'; // Boolean, is the result multiple items? Defaults to true for query modules, to false for other modules
+ const PROP_TYPE = 0; // Type of the property, uses same format as PARAM_TYPE
+ const PROP_NULLABLE = 1; // Boolean, can the property be not included in the result? Defaults to false
+
const LIMIT_BIG1 = 500; // Fast query, std user limit
const LIMIT_BIG2 = 5000; // Fast query, bot/sysop limit
const LIMIT_SML1 = 50; // Slow query, std user limit
return $desc;
}
+ /**
+ * Returns possible properties in the result, grouped by the value of the prop parameter
+ * that shows them.
+ *
+ * Properties that are shown always are in a group with empty string as a key.
+ * Properties that can be shown by several values of prop are included multiple times.
+ * If some properties are part of a list and some are on the root object (see ApiQueryQueryPage),
+ * those on the root object are under the key PROP_ROOT.
+ * The array can also contain a boolean under the key PROP_LIST,
+ * indicating whether the result is a list.
+ *
+ * Don't call this functon directly: use getFinalResultProperties() to
+ * allow hooks to modify descriptions as needed.
+ *
+ * @return array|bool False on no properties
+ */
+ protected function getResultProperties() {
+ return false;
+ }
+
+ /**
+ * Get final possible result properties, after hooks have had a chance to tweak it as
+ * needed.
+ *
+ * @return array
+ */
+ public function getFinalResultProperties() {
+ $properties = $this->getResultProperties();
+ wfRunHooks( 'APIGetResultProperties', array( $this, &$properties ) );
+ return $properties;
+ }
+
+ /**
+ * Add token properties to the array used by getResultProperties,
+ * based on a token functions mapping.
+ */
+ protected static function addTokenProperties( &$props, $tokenFunctions ) {
+ foreach ( array_keys( $tokenFunctions ) as $token ) {
+ $props[''][$token . 'token'] = array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ );
+ }
+ }
+
/**
* Get final module description, after hooks have had a chance to tweak it as
* needed.
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'blocktoken' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'user' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'userID' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'expiry' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'id' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'reason' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'anononly' => 'boolean',
+ 'nocreate' => 'boolean',
+ 'autoblock' => 'boolean',
+ 'noemail' => 'boolean',
+ 'hidename' => 'boolean',
+ 'allowusertalk' => 'boolean',
+ 'watchuser' => 'boolean'
+ )
+ );
+ }
+
public function getDescription() {
return 'Block a user';
}
'torev' => 'Second revision to compare',
);
}
+
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'fromtitle' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'fromrevid' => 'integer',
+ 'totitle' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'torevid' => 'integer',
+ '*' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return array(
'Get the difference between 2 pages',
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'title' => 'string',
+ 'reason' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return 'Delete a page';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'new' => 'boolean',
+ 'result' => array(
+ ApiBase::PROP_TYPE => array(
+ 'Success',
+ 'Failure'
+ ),
+ ),
+ 'pageid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'title' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'nochange' => 'boolean',
+ 'oldrevid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'newrevid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'newtimestamp' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
+ }
+
public function needsToken() {
return true;
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'result' => array(
+ ApiBase::PROP_TYPE => array(
+ 'Success',
+ 'Failure'
+ ),
+ ),
+ 'message' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
+ }
+
public function getDescription() {
return 'Email a user.';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ '*' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return 'Expands all templates in wikitext';
}
}
public function getParamDescription() {
- $params = array(
+ return array(
'filename' => 'Target filename without the File: prefix',
'token' => 'Edit token. You can get one of these through prop=info',
'comment' => 'Upload comment',
'archivename' => 'Archive name of the revision to revert to',
);
+ }
- return $params;
-
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'result' => array(
+ ApiBase::PROP_TYPE => array(
+ 'Success',
+ 'Failure'
+ )
+ ),
+ 'errors' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
}
public function getDescription() {
);
}
+ public function getResultProperties() {
+ return array(
+ ApiBase::PROP_LIST => true,
+ '' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string',
+ 'revisions' => 'integer'
+ )
+ );
+ }
+
public function getDescription() {
return array(
'Import a page from another wiki, or an XML file.' ,
// Add a result entry
$r = array();
- if ( $title === null ) {\r
+ if ( $title === null ) {
# Invalid or non-importable title
$r['title'] = $pageInfo['title'];
- $r['invalid'] = '';\r
- } else {\r
+ $r['invalid'] = '';
+ } else {
ApiQueryBase::addTitleInfo( $r, $title );
$r['revisions'] = intval( $successCount );
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'result' => array(
+ ApiBase::PROP_TYPE => array(
+ 'Success',
+ 'NeedToken',
+ 'WrongToken',
+ 'NoName',
+ 'Illegal',
+ 'WrongPluginPass',
+ 'NotExists',
+ 'WrongPass',
+ 'EmptyPass',
+ 'CreateBlocked',
+ 'Throttled',
+ 'Blocked',
+ 'Aborted'
+ )
+ ),
+ 'lguserid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'lgusername' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'lgtoken' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'cookieprefix' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'sessionid' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'token' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'details' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'wait' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'reason' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
+ }
+
public function getDescription() {
return array(
'Log in and get the authentication tokens. ',
return array();
}
+ public function getResultProperties() {
+ return array();
+ }
+
public function getParamDescription() {
return array();
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'from' => 'string',
+ 'to' => 'string',
+ 'reason' => 'string',
+ 'redirectcreated' => 'boolean',
+ 'talkfrom' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'talkto' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'talkmove-error-code' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'talkmove-error-info' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
+ }
+
public function getDescription() {
return 'Move a page';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ '*' => array(
+ ApiBase::PROP_TYPE => array(
+ 'success'
+ )
+ )
+ )
+ );
+ }
+
public function getParamDescription() {
return array(
'token' => 'An options token previously obtained through the action=tokens',
}
$result->setIndexedTagName( $retval['parameters'], 'param' );
+ $props = $obj->getFinalResultProperties();
+ $listResult = null;
+ if ( $props !== false ) {
+ $retval['props'] = array();
+
+ foreach ( $props as $prop => $properties ) {
+ $propResult = array();
+ if ( $prop == ApiBase::PROP_LIST ) {
+ $listResult = $properties;
+ continue;
+ }
+ if ( $prop != ApiBase::PROP_ROOT ) {
+ $propResult['name'] = $prop;
+ }
+ $propResult['properties'] = array();
+
+ foreach ( $properties as $name => $p ) {
+ $propertyResult = array();
+
+ $propertyResult['name'] = $name;
+
+ if ( !is_array( $p ) ) {
+ $p = array( ApiBase::PROP_TYPE => $p );
+ }
+
+ $propertyResult['type'] = $p[ApiBase::PROP_TYPE];
+
+ if ( is_array( $propertyResult['type'] ) ) {
+ $propertyResult['type'] = array_values( $propertyResult['type'] );
+ $result->setIndexedTagName( $propertyResult['type'], 't' );
+ }
+
+ $nullable = null;
+ if ( isset( $p[ApiBase::PROP_NULLABLE] ) ) {
+ $nullable = $p[ApiBase::PROP_NULLABLE];
+ }
+
+ if ( $nullable === true ) {
+ $propertyResult['nullable'] = '';
+ }
+
+ $propResult['properties'][] = $propertyResult;
+ }
+
+ $result->setIndexedTagName( $propResult['properties'], 'property' );
+ $retval['props'][] = $propResult;
+ }
+
+ // default is true for query modules, false for other modules, overriden by ApiBase::PROP_LIST
+ if ( $listResult === true || ( $listResult !== false && $obj instanceof ApiQueryBase ) ) {
+ $retval['listresult'] = '';
+ }
+
+ $result->setIndexedTagName( $retval['props'], 'prop' );
+ }
+
// Errors
$retval['errors'] = $this->parseErrors( $obj->getPossibleErrors() );
$result->setIndexedTagName( $retval['errors'], 'error' );
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'rcid' => 'integer',
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return 'Patrol a page or revision';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'title' => 'string',
+ 'reason' => 'string',
+ 'cascade' => 'boolean'
+ )
+ );
+ }
+
public function getDescription() {
return 'Change the protection level of a page';
}
);
}
+ public function getResultProperties() {
+ return array(
+ ApiBase::PROP_LIST => true,
+ '' => array(
+ 'ns' => array(
+ ApiBase::PROP_TYPE => 'namespace',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'title' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'pageid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'revid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'invalid' => 'boolean',
+ 'missing' => 'boolean',
+ 'purged' => 'boolean',
+ 'linkupdate' => 'boolean'
+ )
+ );
+ }
+
public function getDescription() {
return array( 'Purge the cache for the given titles.',
'Requires a POST request if the user is not logged in.'
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ '*' => 'string'
+ ),
+ 'size' => array(
+ 'size' => 'integer',
+ 'pages' => 'integer',
+ 'files' => 'integer',
+ 'subcats' => 'integer'
+ ),
+ 'hidden' => array(
+ 'hidden' => 'boolean'
+ )
+ );
+ }
+
public function getDescription() {
return 'Enumerate all categories';
}
private $propertyFilter = array( 'archivename' );
+ public function getResultProperties() {
+ return array_merge(
+ array(
+ '' => array(
+ 'name' => 'string',
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ )
+ ),
+ ApiQueryImageInfo::getResultPropertiesFiltered( $this->propertyFilter )
+ );
+ }
+
public function getDescription() {
return 'Enumerate all images sequentially';
}
);
}
+ public function getResultProperties() {
+ return array(
+ 'ids' => array(
+ 'fromid' => 'integer'
+ ),
+ 'title' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return 'Enumerate all links that point to a given namespace';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'name' => 'string',
+ 'customised' => 'boolean',
+ 'missing' => 'boolean',
+ '*' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'default' => array(
+ 'defaultmissing' => 'boolean',
+ 'default' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
+ }
+
public function getDescription() {
return 'Return messages from this site';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'pageid' => 'integer',
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return 'Enumerate all pages sequentially in a given namespace';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'userid' => 'integer',
+ 'name' => 'string',
+ 'recenteditcount' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'blockinfo' => array(
+ 'blockid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'blockedby' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'blockedbyid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'blockedreason' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'blockedexpiry' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'hidden' => 'boolean'
+ ),
+ 'editcount' => array(
+ 'editcount' => 'integer'
+ ),
+ 'registration' => array(
+ 'registration' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return 'Enumerate all registered users';
}
) );
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'pageid' => 'integer',
+ 'ns' => 'namespace',
+ 'title' => 'string',
+ 'redirect' => 'boolean'
+ )
+ );
+ }
+
public function getDescription() {
switch ( $this->getModuleName() ) {
case 'backlinks':
);
}
+ public function getResultProperties() {
+ return array(
+ 'id' => array(
+ 'id' => 'integer'
+ ),
+ 'user' => array(
+ 'user' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'userid' => array(
+ 'userid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'by' => array(
+ 'by' => 'string'
+ ),
+ 'byid' => array(
+ 'byid' => 'integer'
+ ),
+ 'timestamp' => array(
+ 'timestamp' => 'timestamp'
+ ),
+ 'expiry' => array(
+ 'expiry' => 'timestamp'
+ ),
+ 'reason' => array(
+ 'reason' => 'string'
+ ),
+ 'range' => array(
+ 'rangestart' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'rangeend' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'flags' => array(
+ 'automatic' => 'boolean',
+ 'anononly' => 'boolean',
+ 'nocreate' => 'boolean',
+ 'autoblock' => 'boolean',
+ 'noemail' => 'boolean',
+ 'hidden' => 'boolean',
+ 'allowusertalk' => 'boolean'
+ )
+ );
+ }
+
public function getDescription() {
return 'List all blocked users and IP addresses';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ ),
+ 'sortkey' => array(
+ 'sortkey' => 'string',
+ 'sortkeyprefix' => 'string'
+ ),
+ 'timestamp' => array(
+ 'timestamp' => 'timestamp'
+ ),
+ 'hidden' => array(
+ 'hidden' => 'boolean'
+ )
+ );
+ }
+
public function getDescription() {
return 'List all categories the page(s) belong to';
}
);
}
+ public function getResultProperties() {
+ return array(
+ ApiBase::PROP_LIST => false,
+ '' => array(
+ 'size' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => false
+ ),
+ 'pages' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => false
+ ),
+ 'files' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => false
+ ),
+ 'subcats' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => false
+ ),
+ 'hidden' => array(
+ ApiBase::PROP_TYPE => 'boolean',
+ ApiBase::PROP_NULLABLE => false
+ )
+ )
+ );
+ }
+
public function getDescription() {
return 'Returns information about the given categories';
}
return $desc;
}
+ public function getResultProperties() {
+ return array(
+ 'ids' => array(
+ 'pageid' => 'integer'
+ ),
+ 'title' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ ),
+ 'sortkey' => array(
+ 'sortkey' => 'string'
+ ),
+ 'sortkeyprefix' => array(
+ 'sortkeyprefix' => 'string'
+ ),
+ 'type' => array(
+ 'type' => array(
+ ApiBase::PROP_TYPE => array(
+ 'page',
+ 'subcat',
+ 'file'
+ )
+ )
+ ),
+ 'timestamp' => array(
+ 'timestamp' => 'timestamp'
+ )
+ );
+ }
+
public function getDescription() {
return 'List all pages in a given category';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ ),
+ 'token' => array(
+ 'token' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
$p = $this->getModulePrefix();
return array(
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'name' => 'string',
+ 'user' => 'string',
+ 'timestamp' => 'timestamp'
+ )
+ );
+ }
+
public function getDescription() {
return 'List all files that are duplicates of the given file(s)';
}
return $desc;
}
+ public function getResultProperties() {
+ return array(
+ 'ids' => array(
+ 'pageid' => 'integer'
+ ),
+ 'title' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ ),
+ 'url' => array(
+ 'url' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return 'Enumerate pages that contain a given URL';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ '*' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return 'Returns all external urls (not interwikies) from the given page(s)';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'name' => 'string',
+ 'ns' => 'namespace',
+ 'title' => 'string',
+ 'filehidden' => 'boolean',
+ 'commenthidden' => 'boolean',
+ 'userhidden' => 'boolean',
+ 'suppressed' => 'boolean'
+ ),
+ 'sha1' => array(
+ 'sha1' => 'string'
+ ),
+ 'timestamp' => array(
+ 'timestamp' => 'timestamp'
+ ),
+ 'user' => array(
+ 'userid' => 'integer',
+ 'user' => 'string'
+ ),
+ 'size' => array(
+ 'size' => 'integer',
+ 'pagecount' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'height' => 'integer',
+ 'width' => 'integer'
+ ),
+ 'dimensions' => array(
+ 'size' => 'integer',
+ 'pagecount' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'height' => 'integer',
+ 'width' => 'integer'
+ ),
+ 'description' => array(
+ 'description' => 'string'
+ ),
+ 'parseddescription' => array(
+ 'description' => 'string',
+ 'parseddescription' => 'string'
+ ),
+ 'metadata' => array(
+ 'metadata' => 'string'
+ ),
+ 'bitdepth' => array(
+ 'bitdepth' => 'integer'
+ ),
+ 'mime' => array(
+ 'mime' => 'string'
+ ),
+ 'mediatype' => array(
+ 'mediatype' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return 'Enumerate all deleted files sequentially';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'pageid' => 'integer',
+ 'ns' => 'namespace',
+ 'title' => 'string',
+ 'redirect' => 'boolean'
+ ),
+ 'iwprefix' => array(
+ 'iwprefix' => 'string'
+ ),
+ 'iwtitle' => array(
+ 'iwtitle' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return array( 'Find all pages that link to the given interwiki link.',
'Can be used to find all links with a prefix, or',
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'prefix' => 'string',
+ 'url' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ '*' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return 'Returns all interwiki links from the given page(s)';
}
);
}
+ public static function getResultPropertiesFiltered( $filter = array() ) {
+ $props = array(
+ 'timestamp' => array(
+ 'timestamp' => 'timestamp'
+ ),
+ 'user' => array(
+ 'userhidden' => 'boolean',
+ 'user' => 'string',
+ 'anon' => 'boolean'
+ ),
+ 'userid' => array(
+ 'userhidden' => 'boolean',
+ 'userid' => 'integer',
+ 'anon' => 'boolean'
+ ),
+ 'size' => array(
+ 'size' => 'integer',
+ 'width' => 'integer',
+ 'height' => 'integer',
+ 'pagecount' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'comment' => array(
+ 'commenthidden' => 'boolean',
+ 'comment' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'parsedcomment' => array(
+ 'commenthidden' => 'boolean',
+ 'parsedcomment' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'url' => array(
+ 'filehidden' => 'boolean',
+ 'thumburl' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'thumbwidth' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'thumbheight' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'thumberror' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'url' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'descriptionurl' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'sha1' => array(
+ 'filehidden' => 'boolean',
+ 'sha1' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'mime' => array(
+ 'filehidden' => 'boolean',
+ 'mime' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'mediatype' => array(
+ 'filehidden' => 'boolean',
+ 'mediatype' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'archivename' => array(
+ 'filehidden' => 'boolean',
+ 'archivename' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'bitdepth' => array(
+ 'filehidden' => 'boolean',
+ 'bitdepth' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ );
+ return array_diff_key( $props, array_flip( $filter ) );
+ }
+
+ public function getResultProperties() {
+ return self::getResultPropertiesFiltered();
+ }
+
public function getDescription() {
return 'Returns image information and upload history';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return 'Returns all images contained on the given page(s)';
}
);
}
+ public function getResultProperties() {
+ $props = array(
+ ApiBase::PROP_LIST => false,
+ '' => array(
+ 'touched' => 'timestamp',
+ 'lastrevid' => 'integer',
+ 'counter' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'length' => 'integer',
+ 'redirect' => 'boolean',
+ 'new' => 'boolean',
+ 'starttimestamp' => array(
+ ApiBase::PROP_TYPE => 'timestamp',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'watched' => array(
+ 'watched' => 'boolean'
+ ),
+ 'talkid' => array(
+ 'talkid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'subjectid' => array(
+ 'subjectid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'url' => array(
+ 'fullurl' => 'string',
+ 'editurl' => 'string'
+ ),
+ 'readable' => array(
+ 'readable' => 'boolean'
+ ),
+ 'preload' => array(
+ 'preload' => 'string'
+ ),
+ 'displaytitle' => array(
+ 'displaytitle' => 'string'
+ )
+ );
+
+ self::addTokenProperties( $props, $this->getTokenFunctions() );
+
+ return $props;
+ }
+
public function getDescription() {
return 'Get basic page information such as namespace, title, last touched date, ...';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'pageid' => 'integer',
+ 'ns' => 'namespace',
+ 'title' => 'string',
+ 'redirect' => 'boolean'
+ ),
+ 'lllang' => array(
+ 'lllang' => 'string'
+ ),
+ 'lltitle' => array(
+ 'lltitle' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return array( 'Find all pages that link to the given language link.',
'Can be used to find all links with a language code, or',
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'lang' => 'string',
+ 'url' => array(
+ ApiBase::PROP_TYPE => 'string',
+ Apibase::PROP_NULLABLE => true
+ ),
+ '*' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return 'Returns all interlanguage links from the given page(s)';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return "Returns all {$this->description}s from the given page(s)";
}
);
}
+ public function getResultProperties() {
+ global $wgLogTypes;
+ return array(
+ 'ids' => array(
+ 'logid' => 'integer',
+ 'pageid' => 'integer'
+ ),
+ 'title' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ ),
+ 'type' => array(
+ 'type' => array(
+ ApiBase::PROP_TYPE => $wgLogTypes
+ ),
+ 'action' => 'string'
+ ),
+ 'details' => array(
+ 'actionhidden' => 'boolean'
+ ),
+ 'user' => array(
+ 'userhidden' => 'boolean',
+ 'user' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'anon' => 'boolean'
+ ),
+ 'userid' => array(
+ 'userhidden' => 'boolean',
+ 'userid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'anon' => 'boolean'
+ ),
+ 'timestamp' => array(
+ 'timestamp' => 'timestamp'
+ ),
+ 'comment' => array(
+ 'commenthidden' => 'boolean',
+ 'comment' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'parsedcomment' => array(
+ 'commenthidden' => 'boolean',
+ 'parsedcomment' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
+ }
+
public function getDescription() {
return 'Get events from logs';
}
);
}
+ public function getResultProperties() {
+ global $wgRestrictionLevels;
+ return array(
+ '' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ ),
+ 'timestamp' => array(
+ 'timestamp' => 'timestamp'
+ ),
+ 'user' => array(
+ 'user' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'userid' => 'integer'
+ ),
+ 'comment' => array(
+ 'comment' => 'string'
+ ),
+ 'parsedcomment' => array(
+ 'parsedcomment' => 'string'
+ ),
+ 'expiry' => array(
+ 'expiry' => 'timestamp'
+ ),
+ 'level' => array(
+ 'level' => array(
+ ApiBase::PROP_TYPE => array_diff( $wgRestrictionLevels, array( '' ) )
+ )
+ )
+ );
+ }
+
public function getDescription() {
return 'List all titles protected from creation';
}
);
}
+ public function getResultProperties() {
+ return array(
+ ApiBase::PROP_ROOT => array(
+ 'name' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => false
+ ),
+ 'disabled' => array(
+ ApiBase::PROP_TYPE => 'boolean',
+ ApiBase::PROP_NULLABLE => false
+ ),
+ 'cached' => array(
+ ApiBase::PROP_TYPE => 'boolean',
+ Apibase::PROP_NULLABLE => false
+ ),
+ 'cachedtimestamp' => array(
+ ApiBase::PROP_TYPE => 'timestamp',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ '' => array(
+ 'value' => 'string',
+ 'timestamp' => array(
+ ApiBase::PROP_TYPE => 'timestamp',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return 'Get a list provided by a QueryPage-based special page';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'id' => 'integer',
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return array(
'Get a set of random pages',
);
}
+ public function getResultProperties() {
+ global $wgLogTypes;
+ $props = array(
+ '' => array(
+ 'type' => array(
+ ApiBase::PROP_TYPE => array(
+ 'edit',
+ 'new',
+ 'move',
+ 'log',
+ 'move over redirect'
+ )
+ )
+ ),
+ 'title' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string',
+ 'new_ns' => array(
+ ApiBase::PROP_TYPE => 'namespace',
+ Apibase::PROP_NULLABLE => true
+ ),
+ 'new_title' => array(
+ ApiBase::PROP_TYPE => 'string',
+ Apibase::PROP_NULLABLE => true
+ )
+ ),
+ 'ids' => array(
+ 'rcid' => 'integer',
+ 'pageid' => 'integer',
+ 'revid' => 'integer',
+ 'old_revid' => 'integer'
+ ),
+ 'user' => array(
+ 'user' => 'string',
+ 'anon' => 'boolean'
+ ),
+ 'userid' => array(
+ 'userid' => 'integer',
+ 'anon' => 'boolean'
+ ),
+ 'flags' => array(
+ 'bot' => 'boolean',
+ 'new' => 'boolean',
+ 'minor' => 'boolean'
+ ),
+ 'sizes' => array(
+ 'oldlen' => 'integer',
+ 'newlen' => 'integer'
+ ),
+ 'timestamp' => array(
+ 'timestamp' => 'timestamp'
+ ),
+ 'comment' => array(
+ 'comment' => array(
+ ApiBase::PROP_TYPE => 'string',
+ Apibase::PROP_NULLABLE => true
+ )
+ ),
+ 'parsedcomment' => array(
+ 'parsedcomment' => array(
+ ApiBase::PROP_TYPE => 'string',
+ Apibase::PROP_NULLABLE => true
+ )
+ ),
+ 'redirect' => array(
+ 'redirect' => 'boolean'
+ ),
+ 'patrolled' => array(
+ 'patrolled' => 'boolean'
+ ),
+ 'loginfo' => array(
+ 'logid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ Apibase::PROP_NULLABLE => true
+ ),
+ 'logtype' => array(
+ ApiBase::PROP_TYPE => $wgLogTypes,
+ Apibase::PROP_NULLABLE => true
+ ),
+ 'logaction' => array(
+ ApiBase::PROP_TYPE => 'string',
+ Apibase::PROP_NULLABLE => true
+ )
+ )
+ );
+
+ self::addTokenProperties( $props, $this->getTokenFunctions() );
+
+ return $props;
+ }
+
public function getDescription() {
return 'Enumerate recent changes';
}
);
}
+ public function getResultProperties() {
+ $props = array(
+ '' => array(),
+ 'ids' => array(
+ 'revid' => 'integer',
+ 'parentid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'flags' => array(
+ 'minor' => 'boolean'
+ ),
+ 'user' => array(
+ 'userhidden' => 'boolean',
+ 'user' => 'string',
+ 'anon' => 'boolean'
+ ),
+ 'userid' => array(
+ 'userhidden' => 'boolean',
+ 'userid' => 'integer',
+ 'anon' => 'boolean'
+ ),
+ 'timestamp' => array(
+ 'timestamp' => 'timestamp'
+ ),
+ 'size' => array(
+ 'size' => 'integer'
+ ),
+ 'sha1' => array(
+ 'sha1' => 'string'
+ ),
+ 'comment' => array(
+ 'commenthidden' => 'boolean',
+ 'comment' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'parsedcomment' => array(
+ 'commenthidden' => 'boolean',
+ 'parsedcomment' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'content' => array(
+ '*' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'texthidden' => 'boolean'
+ )
+ );
+
+ self::addTokenProperties( $props, $this->getTokenFunctions() );
+
+ return $props;
+ }
+
public function getDescription() {
return array(
'Get revision information',
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ ),
+ 'snippet' => array(
+ 'snippet' => 'string'
+ ),
+ 'size' => array(
+ 'size' => 'integer'
+ ),
+ 'wordcount' => array(
+ 'wordcount' => 'integer'
+ ),
+ 'timestamp' => array(
+ 'timestamp' => 'timestamp'
+ ),
+ 'score' => array(
+ 'score' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'titlesnippet' => array(
+ 'titlesnippet' => 'string'
+ ),
+ 'redirecttitle' => array(
+ 'redirecttitle' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'redirectsnippet' => array(
+ 'redirectsnippet' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'sectiontitle' => array(
+ 'sectiontitle' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'sectionsnippet' => array(
+ 'sectionsnippet' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'hasrelated' => array(
+ 'hasrelated' => 'boolean'
+ )
+ );
+ }
+
public function getDescription() {
return 'Perform a full text search';
}
);
}
+ public function getResultProperties() {
+ return ApiQueryImageInfo::getResultPropertiesFiltered( $this->propertyFilter );
+ }
+
public function getDescription() {
return 'Returns image information for stashed images';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'name' => 'string'
+ ),
+ 'displayname' => array(
+ 'displayname' => 'string'
+ ),
+ 'description' => array(
+ 'description' => 'string'
+ ),
+ 'hitcount' => array(
+ 'hitcount' => 'integer'
+ )
+ );
+ }
+
public function getDescription() {
return 'List change tags';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'userid' => 'integer',
+ 'user' => 'string',
+ 'userhidden' => 'boolean'
+ ),
+ 'ids' => array(
+ 'pageid' => 'integer',
+ 'revid' => 'integer'
+ ),
+ 'title' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ ),
+ 'timestamp' => array(
+ 'timestamp' => 'timestamp'
+ ),
+ 'flags' => array(
+ 'new' => 'boolean',
+ 'minor' => 'boolean',
+ 'top' => 'boolean'
+ ),
+ 'comment' => array(
+ 'commenthidden' => 'boolean',
+ 'comment' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'parsedcomment' => array(
+ 'commenthidden' => 'boolean',
+ 'parsedcomment' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'patrolled' => array(
+ 'patrolled' => 'boolean'
+ ),
+ 'size' => array(
+ 'size' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
+ }
+
public function getDescription() {
return 'Get all edits by a user';
}
);
}
+ public function getResultProperties() {
+ return array(
+ ApiBase::PROP_LIST => false,
+ '' => array(
+ 'id' => 'integer',
+ 'name' => 'string',
+ 'anon' => 'boolean'
+ ),
+ 'blockinfo' => array(
+ 'blockid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'blockedby' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'blockedbyid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'blockedreason' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'hasmsg' => array(
+ 'messages' => 'boolean'
+ ),
+ 'preferencestoken' => array(
+ 'preferencestoken' => 'string'
+ ),
+ 'editcount' => array(
+ 'editcount' => 'integer'
+ ),
+ 'realname' => array(
+ 'realname' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'email' => array(
+ 'email' => 'string',
+ 'emailauthenticated' => array(
+ ApiBase::PROP_TYPE => 'timestamp',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'registrationdate' => array(
+ 'registrationdate' => array(
+ ApiBase::PROP_TYPE => 'timestamp',
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
+ }
+
public function getDescription() {
return 'Get information about the current user';
}
);
}
+ public function getResultProperties() {
+ $props = array(
+ '' => array(
+ 'userid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'name' => 'string',
+ 'invalid' => 'boolean',
+ 'hidden' => 'boolean',
+ 'interwiki' => 'boolean',
+ 'missing' => 'boolean'
+ ),
+ 'editcount' => array(
+ 'editcount' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'registration' => array(
+ 'registration' => array(
+ ApiBase::PROP_TYPE => 'timestamp',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'blockinfo' => array(
+ 'blockid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'blockedby' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'blockedbyid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'blockedreason' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'blockedexpiry' => array(
+ ApiBase::PROP_TYPE => 'timestamp',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'emailable' => array(
+ 'emailable' => 'boolean'
+ ),
+ 'gender' => array(
+ 'gender' => array(
+ ApiBase::PROP_TYPE => array(
+ 'male',
+ 'female',
+ 'unknown'
+ ),
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
+
+ self::addTokenProperties( $props, $this->getTokenFunctions() );
+
+ return $props;
+ }
+
public function getDescription() {
return 'Get information about a list of users';
}
);
}
+ public function getResultProperties() {
+ global $wgLogTypes;
+ return array(
+ 'ids' => array(
+ 'pageid' => 'integer',
+ 'revid' => 'integer',
+ 'old_revid' => 'integer'
+ ),
+ 'title' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ ),
+ 'user' => array(
+ 'user' => 'string',
+ 'anon' => 'boolean'
+ ),
+ 'userid' => array(
+ 'userid' => 'integer',
+ 'anon' => 'boolean'
+ ),
+ 'flags' => array(
+ 'new' => 'boolean',
+ 'minor' => 'boolean',
+ 'bot' => 'boolean'
+ ),
+ 'patrol' => array(
+ 'patrolled' => 'boolean'
+ ),
+ 'timestamp' => array(
+ 'timestamp' => 'timestamp'
+ ),
+ 'sizes' => array(
+ 'oldlen' => 'integer',
+ 'newlen' => 'integer'
+ ),
+ 'notificationtimestamp' => array(
+ 'notificationtimestamp' => array(
+ ApiBase::PROP_TYPE => 'timestamp',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'comment' => array(
+ 'comment' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'parsedcomment' => array(
+ 'parsedcomment' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'loginfo' => array(
+ 'logid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'logtype' => array(
+ ApiBase::PROP_TYPE => $wgLogTypes,
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'logaction' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
+ }
+
public function getDescription() {
return "Get all recent changes to pages in the logged in user's watchlist";
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ ),
+ 'changed' => array(
+ 'changed' => array(
+ ApiBase::PROP_TYPE => 'timestamp',
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
+ }
+
public function getDescription() {
return "Get all pages on the logged in user's watchlist";
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'title' => 'string',
+ 'pageid' => 'integer',
+ 'summary' => 'string',
+ 'revid' => 'integer',
+ 'old_revid' => 'integer',
+ 'last_revid' => 'integer'
+ )
+ );
+ }
+
public function getDescription() {
return array(
'Undo the last edit to the page. If the last user who edited the page made multiple edits in a row,',
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'patroltoken' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'edittoken' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'deletetoken' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'protecttoken' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'movetoken' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'blocktoken' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'unblocktoken' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'emailtoken' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'importtoken' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'watchtoken' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'optionstoken' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
+ }
+
public function getParamDescription() {
return array(
'type' => 'Type of token(s) to request'
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'unblocktoken' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'id' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'user' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'userid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'reason' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
+ }
+
public function getDescription() {
return 'Unblock a user';
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'title' => 'string',
+ 'revisions' => 'integer',
+ 'filerevisions' => 'integer',
+ 'reason' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return array(
'Restore certain revisions of a deleted page. A list of deleted revisions (including timestamps) can be',
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'result' => array(
+ ApiBase::PROP_TYPE => array(
+ 'Success',
+ 'Warning',
+ 'Continue',
+ 'Queued'
+ ),
+ ),
+ 'filekey' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'sessionkey' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'offset' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'statuskey' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'filename' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
+ }
+
public function getDescription() {
return array(
'Upload a file, or get the status of pending uploads. Several methods are available:',
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'title' => 'string',
+ 'unwatched' => 'boolean',
+ 'watched' => 'boolean',
+ 'message' => 'string'
+ )
+ );
+ }
+
public function getDescription() {
return 'Add or remove a page from/to the current user\'s watchlist';
}