summaryrefslogtreecommitdiff
path: root/includes/api/ApiImport.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/ApiImport.php
parent27cf83d177256813e2e802241085fce5dd0f3fb9 (diff)
Update to MediaWiki 1.19.0
Diffstat (limited to 'includes/api/ApiImport.php')
-rw-r--r--includes/api/ApiImport.php18
1 files changed, 6 insertions, 12 deletions
diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php
index ce740efc..ade9f1f3 100644
--- a/includes/api/ApiImport.php
+++ b/includes/api/ApiImport.php
@@ -24,11 +24,6 @@
* @file
*/
-if ( !defined( 'MEDIAWIKI' ) ) {
- // Eclipse helper - will be ignored in production
- require_once( 'ApiBase.php' );
-}
-
/**
* API module that imports an XML file like Special:Import does
*
@@ -41,13 +36,12 @@ class ApiImport extends ApiBase {
}
public function execute() {
- global $wgUser;
-
+ $user = $this->getUser();
$params = $this->extractRequestParams();
$isUpload = false;
if ( isset( $params['interwikisource'] ) ) {
- if ( !$wgUser->isAllowed( 'import' ) ) {
+ if ( !$user->isAllowed( 'import' ) ) {
$this->dieUsageMsg( 'cantimport' );
}
if ( !isset( $params['interwikipage'] ) ) {
@@ -61,7 +55,7 @@ class ApiImport extends ApiBase {
);
} else {
$isUpload = true;
- if ( !$wgUser->isAllowed( 'importupload' ) ) {
+ if ( !$user->isAllowed( 'importupload' ) ) {
$this->dieUsageMsg( 'cantimport-upload' );
}
$source = ImportStreamSource::newFromUpload( 'xml' );
@@ -158,10 +152,10 @@ class ApiImport extends ApiBase {
return '';
}
- protected function getExamples() {
+ public function getExamples() {
return array(
- 'Import [[meta:Help:Parserfunctions]] to namespace 100 with full history:',
- ' api.php?action=import&interwikisource=meta&interwikipage=Help:ParserFunctions&namespace=100&fullhistory=&token=123ABC',
+ 'api.php?action=import&interwikisource=meta&interwikipage=Help:ParserFunctions&namespace=100&fullhistory=&token=123ABC'
+ => 'Import [[meta:Help:Parserfunctions]] to namespace 100 with full history',
);
}