resourceloader: Pass a Config to the ResourceLoader constructor

Instead of relying on the default being main, which is deprecated.

Change-Id: I200e2c2dc922ae1fa5fa68d449403d0287e41786
This commit is contained in:
Kunal Mehta 2014-08-22 23:18:20 -07:00 committed by Krinkle
parent e1c1832588
commit 1d9d9b4d76
3 changed files with 7 additions and 3 deletions

View file

@ -113,7 +113,9 @@ class ResourceLoaderContext {
* @return ResourceLoaderContext
*/
public static function newDummyContext() {
return new self( new ResourceLoader, new FauxRequest( array() ) );
return new self( new ResourceLoader(
ConfigFactory::getDefaultInstance()->makeConfig( 'main' )
), new FauxRequest( array() ) );
}
/**

View file

@ -39,7 +39,9 @@ if ( !$wgRequest->checkUrlExtension() ) {
}
// Respond to resource loading request
$resourceLoader = new ResourceLoader();
$resourceLoader = new ResourceLoader(
ConfigFactory::getDefaultInstance()->makeConfig( 'main' )
);
$resourceLoader->respond( new ResourceLoaderContext( $resourceLoader, $wgRequest ) );
wfProfileOut( 'load.php' );

View file

@ -47,7 +47,7 @@ class CleanupRemovedModules extends Maintenance {
public function execute() {
$dbw = wfGetDB( DB_MASTER );
$rl = new ResourceLoader();
$rl = new ResourceLoader( ConfigFactory::getDefaultInstance()->makeConfig( 'main' ) );
$moduleNames = $rl->getModuleNames();
$moduleList = implode( ', ', array_map( array( $dbw, 'addQuotes' ), $moduleNames ) );
$limit = max( 1, intval( $this->getOption( 'batchsize', 500 ) ) );