diff options
Diffstat (limited to 'includes/api/ApiQueryQueryPage.php')
-rw-r--r-- | includes/api/ApiQueryQueryPage.php | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/includes/api/ApiQueryQueryPage.php b/includes/api/ApiQueryQueryPage.php index 5eba0de6..a8be26d3 100644 --- a/includes/api/ApiQueryQueryPage.php +++ b/includes/api/ApiQueryQueryPage.php @@ -4,7 +4,7 @@ * * Created on Dec 22, 2010 * - * Copyright © 2010 Roan Kattouw <Firstname>.<Lastname>@gmail.com + * Copyright © 2010 Roan Kattouw "<Firstname>.<Lastname>@gmail.com" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -70,6 +70,8 @@ class ApiQueryQueryPage extends ApiQueryGeneratorBase { * @param $resultPageSet ApiPageSet */ public function run( $resultPageSet = null ) { + global $wgQueryCacheLimit; + $params = $this->extractRequestParams(); $result = $this->getResult(); @@ -88,6 +90,7 @@ class ApiQueryQueryPage extends ApiQueryGeneratorBase { if ( $ts ) { $r['cachedtimestamp'] = wfTimestamp( TS_ISO_8601, $ts ); } + $r['maxresults'] = $wgQueryCacheLimit; } } $result->addValue( array( 'query' ), $this->getModuleName(), $r ); @@ -170,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'; } |