'categories' => 'ApiQueryCategories',
'categoryinfo' => 'ApiQueryCategoryInfo',
'contributors' => 'ApiQueryContributors',
+ 'deletedrevisions' => 'ApiQueryDeletedRevisions',
'duplicatefiles' => 'ApiQueryDuplicateFiles',
'extlinks' => 'ApiQueryExternalLinks',
'fileusage' => 'ApiQueryBacklinksprop',
*/
private static $QueryListModules = array(
'allcategories' => 'ApiQueryAllCategories',
+ 'alldeletedrevisions' => 'ApiQueryAllDeletedRevisions',
'allfileusages' => 'ApiQueryAllLinks',
'allimages' => 'ApiQueryAllImages',
'alllinks' => 'ApiQueryAllLinks',
public function execute() {
$this->mParams = $this->extractRequestParams();
+ if ( $this->mParams['continue'] === null && !$this->mParams['rawcontinue'] ) {
+ $this->logFeatureUsage( 'action=query&!rawcontinue&!continue' );
+ $this->setWarning(
+ 'Formatting of continuation data will be changing soon. ' .
+ 'To continue using the current formatting, use the \'rawcontinue\' parameter. ' .
+ 'To begin using the new format, pass an empty string for \'continue\' ' .
+ 'in the initial query.'
+ );
+ }
+
// Instantiate requested modules
$allModules = array();
$this->instantiateModules( $allModules, 'prop' );
}
if ( count( $pages ) ) {
+ $pageSet->populateGeneratorData( $pages );
+
if ( $this->mParams['indexpageids'] ) {
$pageIDs = array_keys( $pages );
// json treats all map keys as strings - converting to match
/**
* Override the parent to generate help messages for all available query modules.
+ * @deprecated since 1.25
* @return string
*/
public function makeHelpMsg() {
+ wfDeprecated( __METHOD__, '1.25' );
// Use parent to make default message for the query module
$msg = parent::makeHelpMsg();
/**
* For all modules of a given group, generate help messages and join them together
+ * @deprecated since 1.25
* @param string $group Module group
* @return string
*/
return true;
}
- public function getParamDescription() {
- return $this->getPageSet()->getFinalParamDescription() + array(
- 'prop' => 'Which properties to get for the titles/revisions/pageids. ' .
- 'Module help is available below',
- 'list' => 'Which lists to get. Module help is available below',
- 'meta' => 'Which metadata to get about the site. Module help is available below',
- 'indexpageids' => 'Include an additional pageids section listing all returned page IDs',
- 'export' => 'Export the current revisions of all given or generated pages',
- 'exportnowrap' => 'Return the export XML without wrapping it in an ' .
- 'XML result (same format as Special:Export). Can only be used with export',
- 'iwurl' => 'Whether to get the full URL if the title is an interwiki link',
- 'continue' => array(
- 'When present, formats query-continue as key-value pairs that ' .
- 'should simply be merged into the original request.',
- 'This parameter must be set to an empty string in the initial query.',
- 'This parameter is recommended for all new development, and ' .
- 'will be made default in the next API version.'
- ),
- 'rawcontinue' => 'Currently ignored. In the future, \'continue=\' will become the ' .
- 'default and this will be needed to receive the raw query-continue data.',
- );
- }
-
- public function getDescription() {
- return array(
- 'Query API module allows applications to get needed pieces of data ' .
- 'from the MediaWiki databases,',
- 'and is loosely based on the old query.php interface.',
- 'All data modifications will first have to use query to acquire a ' .
- 'token to prevent abuse from malicious sites.'
- );
- }
-
- public function getExamples() {
+ protected function getExamplesMessages() {
return array(
- 'api.php?action=query&prop=revisions&meta=siteinfo&' .
- 'titles=Main%20Page&rvprop=user|comment&continue=',
- 'api.php?action=query&generator=allpages&gapprefix=API/&prop=revisions&continue=',
+ 'action=query&prop=revisions&meta=siteinfo&' .
+ 'titles=Main%20Page&rvprop=user|comment&continue='
+ => 'apihelp-query-example-revisions',
+ 'action=query&generator=allpages&gapprefix=API/&prop=revisions&continue='
+ => 'apihelp-query-example-allpages',
);
}