* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to import all scripts in the MediaWiki namespace from a
}
$this->output( "Importing $page\n" );
- $url = wfAppendQuery( $baseUrl, array(
+ $uri = new Uri( $baseUrl );
+ $uri->extendQuery( array(
'action' => 'raw',
'title' => "MediaWiki:{$page}" ) );
+ $url = $uri->toString();
+
$text = Http::get( $url );
$wikiPage = WikiPage::factory( $title );
- $wikiPage->doEdit( $text, "Importing from $url", 0, false, $user );
+ $content = ContentHandler::makeContent( $text, $wikiPage->getTitle() );
+ $wikiPage->doEditContent( $content, "Importing from $url", 0, false, $user );
}
}
$pages = array();
do {
- $url = wfAppendQuery( $baseUrl, $data );
+ $uri = new Uri( $baseUrl );
+ $uri->extendQuery( $data );
+ $url = $uri->toString();
$strResult = Http::get( $url );
//$result = FormatJson::decode( $strResult ); // Still broken
$result = unserialize( $strResult );