From 80aa025528a152c67815a5a114f79418b63b99ff Mon Sep 17 00:00:00 2001 From: Petr Onderka Date: Wed, 2 May 2012 17:00:30 +0200 Subject: [PATCH] Added result properties to action=paraminfo Added information about the properties of the results of API calls to action=paraminfo, including information about "property groups": what should the prop parameter be set to to get that property. Uses the same format for types as parameters already do. The output format of some modules doesn't fit this, so the result properties for them weren't added, or only partially. Partially implemented modules: * expandtemplates: parsetree is in its own tag * protect, allusers, backlinks, deletedrevs, info, imageinfo, logevents, querypage, recentchanges, revisions, searchinfo, usercontribs, userinfo, users, watchlist, upload: response with partially complex structure Not implemented modules: * feedcontributions, feedwatchlist, opensearch, rds: non-standard reponse * help: error is normal response; not very useful for automated tools anyway * paraminfo, parse, pageprops, siteinfo, userrights: response with complex structure Change-Id: Iff2a9bef79f994e73eef3062b4dd5461bff968ab --- RELEASE-NOTES-1.20 | 1 + docs/hooks.txt | 5 + includes/api/ApiBase.php | 50 ++++++++++ includes/api/ApiBlock.php | 38 ++++++++ includes/api/ApiComparePages.php | 19 ++++ includes/api/ApiDelete.php | 9 ++ includes/api/ApiEditPage.php | 35 +++++++ includes/api/ApiEmailUser.php | 17 ++++ includes/api/ApiExpandTemplates.php | 8 ++ includes/api/ApiFileRevert.php | 20 +++- includes/api/ApiImport.php | 17 +++- includes/api/ApiLogin.php | 60 ++++++++++++ includes/api/ApiLogout.php | 4 + includes/api/ApiMove.php | 27 ++++++ includes/api/ApiOptions.php | 12 +++ includes/api/ApiParamInfo.php | 56 +++++++++++ includes/api/ApiPatrol.php | 10 ++ includes/api/ApiProtect.php | 10 ++ includes/api/ApiPurge.php | 28 ++++++ includes/api/ApiQueryAllCategories.php | 17 ++++ includes/api/ApiQueryAllImages.php | 13 +++ includes/api/ApiQueryAllLinks.php | 12 +++ includes/api/ApiQueryAllMessages.php | 21 ++++ includes/api/ApiQueryAllPages.php | 10 ++ includes/api/ApiQueryAllUsers.php | 42 ++++++++ includes/api/ApiQueryBacklinks.php | 11 +++ includes/api/ApiQueryBlocks.php | 54 +++++++++++ includes/api/ApiQueryCategories.php | 19 ++++ includes/api/ApiQueryCategoryInfo.php | 28 ++++++ includes/api/ApiQueryCategoryMembers.php | 30 ++++++ includes/api/ApiQueryDeletedrevs.php | 12 +++ includes/api/ApiQueryDuplicateFiles.php | 10 ++ includes/api/ApiQueryExtLinksUsage.php | 15 +++ includes/api/ApiQueryExternalLinks.php | 8 ++ includes/api/ApiQueryFilearchive.php | 61 ++++++++++++ includes/api/ApiQueryIWBacklinks.php | 17 ++++ includes/api/ApiQueryIWLinks.php | 13 +++ includes/api/ApiQueryImageInfo.php | 108 +++++++++++++++++++++ includes/api/ApiQueryImages.php | 9 ++ includes/api/ApiQueryInfo.php | 53 ++++++++++ includes/api/ApiQueryLangBacklinks.php | 17 ++++ includes/api/ApiQueryLangLinks.php | 13 +++ includes/api/ApiQueryLinks.php | 9 ++ includes/api/ApiQueryLogEvents.php | 56 +++++++++++ includes/api/ApiQueryProtectedTitles.php | 34 +++++++ includes/api/ApiQueryQueryPage.php | 32 ++++++ includes/api/ApiQueryRandom.php | 10 ++ includes/api/ApiQueryRecentChanges.php | 91 +++++++++++++++++ includes/api/ApiQueryRevisions.php | 60 ++++++++++++ includes/api/ApiQuerySearch.php | 57 +++++++++++ includes/api/ApiQueryStashImageInfo.php | 4 + includes/api/ApiQueryTags.php | 17 ++++ includes/api/ApiQueryUserContributions.php | 49 ++++++++++ includes/api/ApiQueryUserInfo.php | 57 +++++++++++ includes/api/ApiQueryUsers.php | 67 +++++++++++++ includes/api/ApiQueryWatchlist.php | 70 +++++++++++++ includes/api/ApiQueryWatchlistRaw.php | 15 +++ includes/api/ApiRollback.php | 13 +++ includes/api/ApiTokens.php | 51 ++++++++++ includes/api/ApiUnblock.php | 27 ++++++ includes/api/ApiUndelete.php | 11 +++ includes/api/ApiUpload.php | 35 +++++++ includes/api/ApiWatch.php | 11 +++ 63 files changed, 1789 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index 07d93eec85..2908a0258a 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -132,6 +132,7 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki. * (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 === diff --git a/docs/hooks.txt b/docs/hooks.txt index 8d4bdea4e8..a57d1d2aee 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -331,6 +331,11 @@ descriptions. &$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 diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index f0386a1b35..6a9be24f08 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -56,6 +56,11 @@ abstract class ApiBase extends ContextSource { /// @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 @@ -572,6 +577,51 @@ abstract class ApiBase extends ContextSource { 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. diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php index e229ef01c3..6cd31ae2fa 100644 --- a/includes/api/ApiBlock.php +++ b/includes/api/ApiBlock.php @@ -186,6 +186,44 @@ class ApiBlock extends ApiBase { ); } + 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'; } diff --git a/includes/api/ApiComparePages.php b/includes/api/ApiComparePages.php index 87f096785f..ed72b29bd7 100644 --- a/includes/api/ApiComparePages.php +++ b/includes/api/ApiComparePages.php @@ -124,6 +124,25 @@ class ApiComparePages extends ApiBase { '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', diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index cefdaac783..1927490fe4 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -221,6 +221,15 @@ class ApiDelete extends ApiBase { ); } + public function getResultProperties() { + return array( + '' => array( + 'title' => 'string', + 'reason' => 'string' + ) + ); + } + public function getDescription() { return 'Delete a page'; } diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index 0b7ac410b1..9a160070ab 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -494,6 +494,41 @@ class ApiEditPage extends ApiBase { ); } + 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; } diff --git a/includes/api/ApiEmailUser.php b/includes/api/ApiEmailUser.php index 0032bd81d8..4b6ba00dc4 100644 --- a/includes/api/ApiEmailUser.php +++ b/includes/api/ApiEmailUser.php @@ -113,6 +113,23 @@ class ApiEmailUser extends ApiBase { ); } + 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.'; } diff --git a/includes/api/ApiExpandTemplates.php b/includes/api/ApiExpandTemplates.php index d570534de4..2ed118f6a5 100644 --- a/includes/api/ApiExpandTemplates.php +++ b/includes/api/ApiExpandTemplates.php @@ -103,6 +103,14 @@ class ApiExpandTemplates extends ApiBase { ); } + public function getResultProperties() { + return array( + '' => array( + '*' => 'string' + ) + ); + } + public function getDescription() { return 'Expands all templates in wikitext'; } diff --git a/includes/api/ApiFileRevert.php b/includes/api/ApiFileRevert.php index 5ea257160e..7cac0eb47c 100644 --- a/includes/api/ApiFileRevert.php +++ b/includes/api/ApiFileRevert.php @@ -132,15 +132,29 @@ class ApiFileRevert extends ApiBase { } 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() { diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php index 5093b6b63f..6663d97b52 100644 --- a/includes/api/ApiImport.php +++ b/includes/api/ApiImport.php @@ -126,6 +126,17 @@ class ApiImport extends ApiBase { ); } + 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.' , @@ -187,11 +198,11 @@ class ApiImportReporter extends ImportReporter { // Add a result entry $r = array(); - if ( $title === null ) { + if ( $title === null ) { # Invalid or non-importable title $r['title'] = $pageInfo['title']; - $r['invalid'] = ''; - } else { + $r['invalid'] = ''; + } else { ApiQueryBase::addTitleInfo( $r, $title ); $r['revisions'] = intval( $successCount ); } diff --git a/includes/api/ApiLogin.php b/includes/api/ApiLogin.php index aa570cbc67..0bdaa1b0bc 100644 --- a/includes/api/ApiLogin.php +++ b/includes/api/ApiLogin.php @@ -181,6 +181,66 @@ class ApiLogin extends ApiBase { ); } + 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. ', diff --git a/includes/api/ApiLogout.php b/includes/api/ApiLogout.php index 81a054a674..cab2430547 100644 --- a/includes/api/ApiLogout.php +++ b/includes/api/ApiLogout.php @@ -54,6 +54,10 @@ class ApiLogout extends ApiBase { return array(); } + public function getResultProperties() { + return array(); + } + public function getParamDescription() { return array(); } diff --git a/includes/api/ApiMove.php b/includes/api/ApiMove.php index f0a25e4a70..c89f59bbac 100644 --- a/includes/api/ApiMove.php +++ b/includes/api/ApiMove.php @@ -224,6 +224,33 @@ class ApiMove extends ApiBase { ); } + 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'; } diff --git a/includes/api/ApiOptions.php b/includes/api/ApiOptions.php index 7bcfe1ed47..2b3d5e33b4 100644 --- a/includes/api/ApiOptions.php +++ b/includes/api/ApiOptions.php @@ -107,6 +107,18 @@ class ApiOptions extends ApiBase { ); } + 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', diff --git a/includes/api/ApiParamInfo.php b/includes/api/ApiParamInfo.php index f226347627..dffce5bec0 100644 --- a/includes/api/ApiParamInfo.php +++ b/includes/api/ApiParamInfo.php @@ -251,6 +251,62 @@ class ApiParamInfo extends ApiBase { } $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' ); diff --git a/includes/api/ApiPatrol.php b/includes/api/ApiPatrol.php index 1332f2631a..45d19d0d33 100644 --- a/includes/api/ApiPatrol.php +++ b/includes/api/ApiPatrol.php @@ -80,6 +80,16 @@ class ApiPatrol extends ApiBase { ); } + public function getResultProperties() { + return array( + '' => array( + 'rcid' => 'integer', + 'ns' => 'namespace', + 'title' => 'string' + ) + ); + } + public function getDescription() { return 'Patrol a page or revision'; } diff --git a/includes/api/ApiProtect.php b/includes/api/ApiProtect.php index 286f191f8d..0fcaf42169 100644 --- a/includes/api/ApiProtect.php +++ b/includes/api/ApiProtect.php @@ -184,6 +184,16 @@ class ApiProtect extends ApiBase { ); } + public function getResultProperties() { + return array( + '' => array( + 'title' => 'string', + 'reason' => 'string', + 'cascade' => 'boolean' + ) + ); + } + public function getDescription() { return 'Change the protection level of a page'; } diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index 8e9c198fbb..e27068d156 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -135,6 +135,34 @@ class ApiPurge extends ApiBase { ); } + 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.' diff --git a/includes/api/ApiQueryAllCategories.php b/includes/api/ApiQueryAllCategories.php index 233ea75f86..60b57bfc3a 100644 --- a/includes/api/ApiQueryAllCategories.php +++ b/includes/api/ApiQueryAllCategories.php @@ -192,6 +192,23 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase { ); } + 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'; } diff --git a/includes/api/ApiQueryAllImages.php b/includes/api/ApiQueryAllImages.php index 87e70248df..ce5aac2d38 100644 --- a/includes/api/ApiQueryAllImages.php +++ b/includes/api/ApiQueryAllImages.php @@ -230,6 +230,19 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase { 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'; } diff --git a/includes/api/ApiQueryAllLinks.php b/includes/api/ApiQueryAllLinks.php index f04d5b20e0..6b8fe57f39 100644 --- a/includes/api/ApiQueryAllLinks.php +++ b/includes/api/ApiQueryAllLinks.php @@ -205,6 +205,18 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase { ); } + 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'; } diff --git a/includes/api/ApiQueryAllMessages.php b/includes/api/ApiQueryAllMessages.php index dedd3e5c30..ac000bf373 100644 --- a/includes/api/ApiQueryAllMessages.php +++ b/includes/api/ApiQueryAllMessages.php @@ -256,6 +256,27 @@ class ApiQueryAllMessages extends ApiQueryBase { ); } + 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'; } diff --git a/includes/api/ApiQueryAllPages.php b/includes/api/ApiQueryAllPages.php index 7e89a95b6a..cfc22ff9f1 100644 --- a/includes/api/ApiQueryAllPages.php +++ b/includes/api/ApiQueryAllPages.php @@ -296,6 +296,16 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase { ); } + public function getResultProperties() { + return array( + '' => array( + 'pageid' => 'integer', + 'ns' => 'namespace', + 'title' => 'string' + ) + ); + } + public function getDescription() { return 'Enumerate all pages sequentially in a given namespace'; } diff --git a/includes/api/ApiQueryAllUsers.php b/includes/api/ApiQueryAllUsers.php index e110e6770b..dda8c72950 100644 --- a/includes/api/ApiQueryAllUsers.php +++ b/includes/api/ApiQueryAllUsers.php @@ -377,6 +377,48 @@ class ApiQueryAllUsers extends ApiQueryBase { ); } + 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'; } diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index 55056922e0..fcb9c4bc20 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -481,6 +481,17 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { ) ); } + public function getResultProperties() { + return array( + '' => array( + 'pageid' => 'integer', + 'ns' => 'namespace', + 'title' => 'string', + 'redirect' => 'boolean' + ) + ); + } + public function getDescription() { switch ( $this->getModuleName() ) { case 'backlinks': diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php index 8c287d6929..49cd590694 100644 --- a/includes/api/ApiQueryBlocks.php +++ b/includes/api/ApiQueryBlocks.php @@ -324,6 +324,60 @@ class ApiQueryBlocks extends ApiQueryBase { ); } + 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'; } diff --git a/includes/api/ApiQueryCategories.php b/includes/api/ApiQueryCategories.php index cbda6ab82d..283eb13e8c 100644 --- a/includes/api/ApiQueryCategories.php +++ b/includes/api/ApiQueryCategories.php @@ -240,6 +240,25 @@ class ApiQueryCategories extends ApiQueryGeneratorBase { ); } + 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'; } diff --git a/includes/api/ApiQueryCategoryInfo.php b/includes/api/ApiQueryCategoryInfo.php index c5070e8729..e5eca85481 100644 --- a/includes/api/ApiQueryCategoryInfo.php +++ b/includes/api/ApiQueryCategoryInfo.php @@ -106,6 +106,34 @@ class ApiQueryCategoryInfo extends ApiQueryBase { ); } + 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'; } diff --git a/includes/api/ApiQueryCategoryMembers.php b/includes/api/ApiQueryCategoryMembers.php index 35b5645a0e..9f66f220b7 100644 --- a/includes/api/ApiQueryCategoryMembers.php +++ b/includes/api/ApiQueryCategoryMembers.php @@ -364,6 +364,36 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase { 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'; } diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index 6912ddc2b5..06f649dd91 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -366,6 +366,18 @@ class ApiQueryDeletedrevs extends ApiQueryBase { ); } + public function getResultProperties() { + return array( + '' => array( + 'ns' => 'namespace', + 'title' => 'string' + ), + 'token' => array( + 'token' => 'string' + ) + ); + } + public function getDescription() { $p = $this->getModulePrefix(); return array( diff --git a/includes/api/ApiQueryDuplicateFiles.php b/includes/api/ApiQueryDuplicateFiles.php index 6fb3ea3590..856d0fd78f 100644 --- a/includes/api/ApiQueryDuplicateFiles.php +++ b/includes/api/ApiQueryDuplicateFiles.php @@ -165,6 +165,16 @@ class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase { ); } + 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)'; } diff --git a/includes/api/ApiQueryExtLinksUsage.php b/includes/api/ApiQueryExtLinksUsage.php index 93c71e2fce..221fface56 100644 --- a/includes/api/ApiQueryExtLinksUsage.php +++ b/includes/api/ApiQueryExtLinksUsage.php @@ -232,6 +232,21 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase { 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'; } diff --git a/includes/api/ApiQueryExternalLinks.php b/includes/api/ApiQueryExternalLinks.php index a9fbc839d9..999ddc887c 100644 --- a/includes/api/ApiQueryExternalLinks.php +++ b/includes/api/ApiQueryExternalLinks.php @@ -133,6 +133,14 @@ class ApiQueryExternalLinks extends ApiQueryBase { ); } + public function getResultProperties() { + return array( + '' => array( + '*' => 'string' + ) + ); + } + public function getDescription() { return 'Returns all external urls (not interwikies) from the given page(s)'; } diff --git a/includes/api/ApiQueryFilearchive.php b/includes/api/ApiQueryFilearchive.php index 4d9905566e..07d5b41082 100644 --- a/includes/api/ApiQueryFilearchive.php +++ b/includes/api/ApiQueryFilearchive.php @@ -274,6 +274,67 @@ class ApiQueryFilearchive extends ApiQueryBase { ); } + 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'; } diff --git a/includes/api/ApiQueryIWBacklinks.php b/includes/api/ApiQueryIWBacklinks.php index 2ffe479dd5..d2837e9d46 100644 --- a/includes/api/ApiQueryIWBacklinks.php +++ b/includes/api/ApiQueryIWBacklinks.php @@ -195,6 +195,23 @@ class ApiQueryIWBacklinks extends ApiQueryGeneratorBase { ); } + 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', diff --git a/includes/api/ApiQueryIWLinks.php b/includes/api/ApiQueryIWLinks.php index f39835a1d6..7e69513b2f 100644 --- a/includes/api/ApiQueryIWLinks.php +++ b/includes/api/ApiQueryIWLinks.php @@ -167,6 +167,19 @@ class ApiQueryIWLinks extends ApiQueryBase { ); } + 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)'; } diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 135979acf0..969293b53c 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -547,6 +547,114 @@ class ApiQueryImageInfo extends ApiQueryBase { ); } + 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'; } diff --git a/includes/api/ApiQueryImages.php b/includes/api/ApiQueryImages.php index 6f488cd60c..147ab6725f 100644 --- a/includes/api/ApiQueryImages.php +++ b/includes/api/ApiQueryImages.php @@ -174,6 +174,15 @@ class ApiQueryImages extends ApiQueryGeneratorBase { ); } + public function getResultProperties() { + return array( + '' => array( + 'ns' => 'namespace', + 'title' => 'string' + ) + ); + } + public function getDescription() { return 'Returns all images contained on the given page(s)'; } diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index e5db4d8620..2ff6197336 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -721,6 +721,59 @@ class ApiQueryInfo extends ApiQueryBase { ); } + 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, ...'; } diff --git a/includes/api/ApiQueryLangBacklinks.php b/includes/api/ApiQueryLangBacklinks.php index efc2e814ac..f423719c0c 100644 --- a/includes/api/ApiQueryLangBacklinks.php +++ b/includes/api/ApiQueryLangBacklinks.php @@ -195,6 +195,23 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase { ); } + 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', diff --git a/includes/api/ApiQueryLangLinks.php b/includes/api/ApiQueryLangLinks.php index b6f9a99108..e477b2fb62 100644 --- a/includes/api/ApiQueryLangLinks.php +++ b/includes/api/ApiQueryLangLinks.php @@ -159,6 +159,19 @@ class ApiQueryLangLinks extends ApiQueryBase { ); } + 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)'; } diff --git a/includes/api/ApiQueryLinks.php b/includes/api/ApiQueryLinks.php index 4dea419e6e..5cf9068247 100644 --- a/includes/api/ApiQueryLinks.php +++ b/includes/api/ApiQueryLinks.php @@ -227,6 +227,15 @@ class ApiQueryLinks extends ApiQueryGeneratorBase { ); } + public function getResultProperties() { + return array( + '' => array( + 'ns' => 'namespace', + 'title' => 'string' + ) + ); + } + public function getDescription() { return "Returns all {$this->description}s from the given page(s)"; } diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index e017c4bdb6..bb4b429a36 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -447,6 +447,62 @@ class ApiQueryLogEvents extends ApiQueryBase { ); } + 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'; } diff --git a/includes/api/ApiQueryProtectedTitles.php b/includes/api/ApiQueryProtectedTitles.php index 44cc1d3266..360183c48b 100644 --- a/includes/api/ApiQueryProtectedTitles.php +++ b/includes/api/ApiQueryProtectedTitles.php @@ -214,6 +214,40 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase { ); } + 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'; } diff --git a/includes/api/ApiQueryQueryPage.php b/includes/api/ApiQueryQueryPage.php index 8efe65d696..dab4ab21d5 100644 --- a/includes/api/ApiQueryQueryPage.php +++ b/includes/api/ApiQueryQueryPage.php @@ -173,6 +173,38 @@ class ApiQueryQueryPage extends ApiQueryGeneratorBase { ); } + 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'; } diff --git a/includes/api/ApiQueryRandom.php b/includes/api/ApiQueryRandom.php index 2e9e2dd500..ddf5841b71 100644 --- a/includes/api/ApiQueryRandom.php +++ b/includes/api/ApiQueryRandom.php @@ -161,6 +161,16 @@ class ApiQueryRandom extends ApiQueryGeneratorBase { ); } + public function getResultProperties() { + return array( + '' => array( + 'id' => 'integer', + 'ns' => 'namespace', + 'title' => 'string' + ) + ); + } + public function getDescription() { return array( 'Get a set of random pages', diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 931af08349..f9025c4609 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -629,6 +629,97 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { ); } + 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'; } diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 44cb46ef24..1a5ad174df 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -648,6 +648,66 @@ class ApiQueryRevisions extends ApiQueryBase { ); } + 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', diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index 40aac0505c..ed6c3cb619 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -280,6 +280,63 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { ); } + 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'; } diff --git a/includes/api/ApiQueryStashImageInfo.php b/includes/api/ApiQueryStashImageInfo.php index 4501ec5850..02484ae9b5 100644 --- a/includes/api/ApiQueryStashImageInfo.php +++ b/includes/api/ApiQueryStashImageInfo.php @@ -123,6 +123,10 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { ); } + public function getResultProperties() { + return ApiQueryImageInfo::getResultPropertiesFiltered( $this->propertyFilter ); + } + public function getDescription() { return 'Returns image information for stashed images'; } diff --git a/includes/api/ApiQueryTags.php b/includes/api/ApiQueryTags.php index 12cea1d719..edd1553c0b 100644 --- a/includes/api/ApiQueryTags.php +++ b/includes/api/ApiQueryTags.php @@ -169,6 +169,23 @@ class ApiQueryTags extends ApiQueryBase { ); } + 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'; } diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index 097d3e174e..ab5acf5f0e 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -448,6 +448,55 @@ class ApiQueryContributions extends ApiQueryBase { ); } + 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'; } diff --git a/includes/api/ApiQueryUserInfo.php b/includes/api/ApiQueryUserInfo.php index e3bc775a79..e4617d976c 100644 --- a/includes/api/ApiQueryUserInfo.php +++ b/includes/api/ApiQueryUserInfo.php @@ -234,6 +234,63 @@ class ApiQueryUserInfo extends ApiQueryBase { ); } + 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'; } diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php index 83872a5701..02fcf01f6f 100644 --- a/includes/api/ApiQueryUsers.php +++ b/includes/api/ApiQueryUsers.php @@ -315,6 +315,73 @@ class ApiQueryUsers extends ApiQueryBase { ); } + 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'; } diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 77f6ce9dc4..a93f94ff78 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -418,6 +418,76 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { ); } + 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"; } diff --git a/includes/api/ApiQueryWatchlistRaw.php b/includes/api/ApiQueryWatchlistRaw.php index 5e96dd5336..1b1eee06c4 100644 --- a/includes/api/ApiQueryWatchlistRaw.php +++ b/includes/api/ApiQueryWatchlistRaw.php @@ -192,6 +192,21 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase { ); } + 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"; } diff --git a/includes/api/ApiRollback.php b/includes/api/ApiRollback.php index 436c392b49..4de49ea9ba 100644 --- a/includes/api/ApiRollback.php +++ b/includes/api/ApiRollback.php @@ -116,6 +116,19 @@ class ApiRollback extends ApiBase { ); } + 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,', diff --git a/includes/api/ApiTokens.php b/includes/api/ApiTokens.php index c56d646cb3..2c9b482c28 100644 --- a/includes/api/ApiTokens.php +++ b/includes/api/ApiTokens.php @@ -84,6 +84,57 @@ class ApiTokens extends ApiBase { ); } + 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' diff --git a/includes/api/ApiUnblock.php b/includes/api/ApiUnblock.php index 49353b61f6..40a6d44811 100644 --- a/includes/api/ApiUnblock.php +++ b/includes/api/ApiUnblock.php @@ -119,6 +119,33 @@ class ApiUnblock extends ApiBase { ); } + 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'; } diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index 856e2ac413..c89f49a425 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -122,6 +122,17 @@ class ApiUndelete extends ApiBase { ); } + 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', diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index e58a1ca075..db1ee1643f 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -623,6 +623,41 @@ class ApiUpload extends ApiBase { } + 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:', diff --git a/includes/api/ApiWatch.php b/includes/api/ApiWatch.php index fa382b3b49..c923c6d4bb 100644 --- a/includes/api/ApiWatch.php +++ b/includes/api/ApiWatch.php @@ -100,6 +100,17 @@ class ApiWatch extends ApiBase { ); } + 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'; } -- 2.20.1