*/
public function __construct() {
parent::__construct( 'Import', 'import' );
- $this->namespace = $this->getConfig()->get( 'ImportTargetNamespace' );
}
/**
* Execute
* @param string|null $par
+ * @throws PermissionsError
+ * @throws ReadOnlyError
*/
function execute( $par ) {
$this->setHeaders();
$this->outputHeader();
+ $this->namespace = $this->getConfig()->get( 'ImportTargetNamespace' );
+
$this->getOutput()->addModules( 'mediawiki.special.import' );
$user = $this->getUser();
$reporter->open();
try {
$importer->doImport();
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
$exception = $e;
}
$result = $reporter->close();
/**
* @param Title $title
- * @param Title $origTitle
+ * @param ForeignTitle $foreignTitle
* @param int $revisionCount
* @param int $successCount
* @param array $pageInfo
* @return void
*/
- function reportPage( $title, $origTitle, $revisionCount, $successCount, $pageInfo ) {
+ function reportPage( $title, $foreignTitle, $revisionCount,
+ $successCount, $pageInfo ) {
$args = func_get_args();
call_user_func_array( $this->mOriginalPageOutCallback, $args );
$log->addEntry( 'upload', $title, $detail, array(), $this->getUser() );
} else {
$interwiki = '[[:' . $this->mInterwiki . ':' .
- $origTitle->getPrefixedText() . ']]';
+ $foreignTitle->getFullText() . ']]';
$detail = $this->msg( 'import-logentry-interwiki-detail' )->numParams(
$successCount )->params( $interwiki )->inContentLanguage()->text();
if ( $this->reason ) {
$page = WikiPage::factory( $title );
# Update page record
$page->updateRevisionOn( $dbw, $nullRevision );
- wfRunHooks(
+ Hooks::run(
'NewRevisionFromEditComplete',
array( $page, $nullRevision, $latest, $this->getUser() )
);