dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Separate language generation from outputPage
[lhc/web/wiklou.git]
/
maintenance
/
importSiteScripts.php
diff --git
a/maintenance/importSiteScripts.php
b/maintenance/importSiteScripts.php
index
b4a1bac
..
fabc6dc
100644
(file)
--- a/
maintenance/importSiteScripts.php
+++ b/
maintenance/importSiteScripts.php
@@
-21,7
+21,7
@@
* @ingroup Maintenance
*/
* @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
/**
* Maintenance script to import all scripts in the MediaWiki namespace from a
@@
-56,16
+56,14
@@
class ImportSiteScripts extends Maintenance {
}
$this->output( "Importing $page\n" );
}
$this->output( "Importing $page\n" );
- $uri = new Uri( $baseUrl );
- $uri->extendQuery( array(
+ $url = wfAppendQuery( $baseUrl, array(
'action' => 'raw',
'title' => "MediaWiki:{$page}" ) );
'action' => 'raw',
'title' => "MediaWiki:{$page}" ) );
- $url = $uri->toString();
-
$text = Http::get( $url );
$wikiPage = WikiPage::factory( $title );
$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 );
}
}
}
}
@@
-82,9
+80,7
@@
class ImportSiteScripts extends Maintenance {
$pages = array();
do {
$pages = array();
do {
- $uri = new Uri( $baseUrl );
- $uri->extendQuery( $data );
- $url = $uri->toString();
+ $url = wfAppendQuery( $baseUrl, $data );
$strResult = Http::get( $url );
//$result = FormatJson::decode( $strResult ); // Still broken
$result = unserialize( $strResult );
$strResult = Http::get( $url );
//$result = FormatJson::decode( $strResult ); // Still broken
$result = unserialize( $strResult );