summaryrefslogtreecommitdiff
path: root/includes/api/ApiQueryQueryPage.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
committerPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
commitd9022f63880ce039446fba8364f68e656b7bf4cb (patch)
tree16b40fbf17bf7c9ee6f4ead25b16dd192378050a /includes/api/ApiQueryQueryPage.php
parent27cf83d177256813e2e802241085fce5dd0f3fb9 (diff)
Update to MediaWiki 1.19.0
Diffstat (limited to 'includes/api/ApiQueryQueryPage.php')
-rw-r--r--includes/api/ApiQueryQueryPage.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/includes/api/ApiQueryQueryPage.php b/includes/api/ApiQueryQueryPage.php
index b38df6b6..5eba0de6 100644
--- a/includes/api/ApiQueryQueryPage.php
+++ b/includes/api/ApiQueryQueryPage.php
@@ -24,11 +24,6 @@
* @file
*/
-if ( !defined( 'MEDIAWIKI' ) ) {
- // Eclipse helper - will be ignored in production
- require_once( 'ApiQueryBase.php' );
-}
-
/**
* Query module to get the results of a QueryPage-based special page
*
@@ -73,15 +68,13 @@ class ApiQueryQueryPage extends ApiQueryGeneratorBase {
/**
* @param $resultPageSet ApiPageSet
- * @return void
*/
public function run( $resultPageSet = null ) {
- global $wgUser;
$params = $this->extractRequestParams();
$result = $this->getResult();
$qp = new $this->qpMap[$params['page']]();
- if ( !$qp->userCanExecute( $wgUser ) ) {
+ if ( !$qp->userCanExecute( $this->getUser() ) ) {
$this->dieUsageMsg( 'specialpage-cantexecute' );
}
@@ -98,7 +91,7 @@ class ApiQueryQueryPage extends ApiQueryGeneratorBase {
}
}
$result->addValue( array( 'query' ), $this->getModuleName(), $r );
-
+
if ( $qp->isCached() && !$qp->isCacheable() ) {
// Disabled query page, don't run the query
return;
@@ -183,10 +176,11 @@ class ApiQueryQueryPage extends ApiQueryGeneratorBase {
public function getPossibleErrors() {
return array_merge( parent::getPossibleErrors(), array(
+ array( 'specialpage-cantexecute' )
) );
}
- protected function getExamples() {
+ public function getExamples() {
return array(
'api.php?action=query&list=querypage&qppage=Ancientpages'
);