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
Merge "filebackend: Restore TempFSFile shutdown-purge functionality"
[lhc/web/wiklou.git]
/
maintenance
/
importSiteScripts.php
diff --git
a/maintenance/importSiteScripts.php
b/maintenance/importSiteScripts.php
index
366594d
..
1d4b496
100644
(file)
--- a/
maintenance/importSiteScripts.php
+++ b/
maintenance/importSiteScripts.php
@@
-21,6
+21,8
@@
* @ingroup Maintenance
*/
* @ingroup Maintenance
*/
+use MediaWiki\MediaWikiServices;
+
require_once __DIR__ . '/Maintenance.php';
/**
require_once __DIR__ . '/Maintenance.php';
/**
@@
-43,7
+45,7
@@
class ImportSiteScripts extends Maintenance {
$username = $this->getOption( 'username', false );
if ( $username === false ) {
$username = $this->getOption( 'username', false );
if ( $username === false ) {
- $user = User::newSystemUser( 'ScriptImporter',
array( 'steal' => true )
);
+ $user = User::newSystemUser( 'ScriptImporter',
[ 'steal' => true ]
);
} else {
$user = User::newFromName( $username );
}
} else {
$user = User::newFromName( $username );
}
@@
-61,10
+63,11
@@
class ImportSiteScripts extends Maintenance {
}
$this->output( "Importing $page\n" );
}
$this->output( "Importing $page\n" );
- $url = wfAppendQuery( $baseUrl,
array(
+ $url = wfAppendQuery( $baseUrl,
[
'action' => 'raw',
'action' => 'raw',
- 'title' => "MediaWiki:{$page}" ) );
- $text = Http::get( $url, array(), __METHOD__ );
+ 'title' => "MediaWiki:{$page}" ] );
+ $text = MediaWikiServices::getInstance()->getHttpRequestFactory()->
+ get( $url, [], __METHOD__ );
$wikiPage = WikiPage::factory( $title );
$content = ContentHandler::makeContent( $text, $wikiPage->getTitle() );
$wikiPage = WikiPage::factory( $title );
$content = ContentHandler::makeContent( $text, $wikiPage->getTitle() );
@@
-73,20
+76,21
@@
class ImportSiteScripts extends Maintenance {
}
protected function fetchScriptList() {
}
protected function fetchScriptList() {
- $data =
array(
+ $data =
[
'action' => 'query',
'format' => 'json',
'list' => 'allpages',
'apnamespace' => '8',
'aplimit' => '500',
'continue' => '',
'action' => 'query',
'format' => 'json',
'list' => 'allpages',
'apnamespace' => '8',
'aplimit' => '500',
'continue' => '',
-
)
;
+
]
;
$baseUrl = $this->getArg( 0 );
$baseUrl = $this->getArg( 0 );
- $pages =
array()
;
+ $pages =
[]
;
while ( true ) {
$url = wfAppendQuery( $baseUrl, $data );
while ( true ) {
$url = wfAppendQuery( $baseUrl, $data );
- $strResult = Http::get( $url, array(), __METHOD__ );
+ $strResult = MediaWikiServices::getInstance()->getHttpRequestFactory()->
+ get( $url, [], __METHOD__ );
$result = FormatJson::decode( $strResult, true );
$page = null;
$result = FormatJson::decode( $strResult, true );
$page = null;
@@
-114,5
+118,5
@@
class ImportSiteScripts extends Maintenance {
}
}
}
}
-$maintClass =
'ImportSiteScripts'
;
+$maintClass =
ImportSiteScripts::class
;
require_once RUN_MAINTENANCE_IF_MAIN;
require_once RUN_MAINTENANCE_IF_MAIN;