X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiImport.php;h=a1340743e25722622a08f05e61899e3fd8987f3a;hb=87070fc6743bfe5da7b49f07561fc1e0b03897c4;hp=b11348e5b1711806b8050e342dceb06db6025e97;hpb=48d433b102e636644d833e408ba028880f90f62a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php index b11348e5b1..a1340743e2 100644 --- a/includes/api/ApiImport.php +++ b/includes/api/ApiImport.php @@ -60,7 +60,7 @@ class ApiImport extends ApiBase { $this->dieStatus( $source ); } - $importer = new WikiImporter( $source->value ); + $importer = new WikiImporter( $source->value, $this->getConfig() ); if ( isset( $params['namespace'] ) ) { $importer->setTargetNamespace( $params['namespace'] ); } @@ -116,36 +116,15 @@ class ApiImport extends ApiBase { ); } - public function getParamDescription() { - return array( - 'summary' => 'Import summary', - 'xml' => 'Uploaded XML file', - 'interwikisource' => 'For interwiki imports: wiki to import from', - 'interwikipage' => 'For interwiki imports: page to import', - 'fullhistory' => 'For interwiki imports: import the full history, not just the current version', - 'templates' => 'For interwiki imports: import all included templates as well', - 'namespace' => 'For interwiki imports: import to this namespace', - 'rootpage' => 'Import as subpage of this page', - ); - } - - public function getDescription() { - return array( - 'Import a page from another wiki, or an XML file.', - 'Note that the HTTP POST must be done as a file upload (i.e. using multipart/form-data) when', - 'sending a file for the "xml" parameter.' - ); - } - public function needsToken() { return 'csrf'; } - public function getExamples() { + protected function getExamplesMessages() { return array( - 'api.php?action=import&interwikisource=meta&interwikipage=Help:ParserFunctions&' . + 'action=import&interwikisource=meta&interwikipage=Help:ParserFunctions&' . 'namespace=100&fullhistory=&token=123ABC' - => 'Import [[meta:Help:Parserfunctions]] to namespace 100 with full history', + => 'apihelp-import-example-import', ); }