From d9022f63880ce039446fba8364f68e656b7bf4cb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 3 May 2012 13:01:35 +0200 Subject: Update to MediaWiki 1.19.0 --- maintenance/importSiteScripts.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'maintenance/importSiteScripts.php') diff --git a/maintenance/importSiteScripts.php b/maintenance/importSiteScripts.php index 849c7b1b..0dc200ec 100644 --- a/maintenance/importSiteScripts.php +++ b/maintenance/importSiteScripts.php @@ -1,8 +1,11 @@ getOption( 'username', 'ScriptImporter' ) ); + + $user = User::newFromName( $this->getOption( 'username', 'ScriptImporter' ) ); + $wgUser = $user; $baseUrl = $this->getArg( 1 ); $pageList = $this->fetchScriptList(); $this->output( 'Importing ' . count( $pageList ) . " pages\n" ); foreach ( $pageList as $page ) { + $title = Title::makeTitleSafe( NS_MEDIAWIKI, $page ); + if ( !$title ) { + $this->error( "$page is an invalid title; it will not be imported\n" ); + continue; + } + $this->output( "Importing $page\n" ); $url = wfAppendQuery( $baseUrl, array( 'action' => 'raw', 'title' => "MediaWiki:{$page}" ) ); $text = Http::get( $url ); - - $title = Title::makeTitleSafe( NS_MEDIAWIKI, $page ); - $article = new Article( $title ); - $article->doEdit( $text, "Importing from $url", 0 ); + + $wikiPage = WikiPage::factory( $title ); + $wikiPage->doEdit( $text, "Importing from $url", 0, false, $user ); } } -- cgit v1.2.3-54-g00ecf