From 1d9d9b4d7677613d6280712f97207b3bab6427ac Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Fri, 22 Aug 2014 23:18:20 -0700 Subject: [PATCH] resourceloader: Pass a Config to the ResourceLoader constructor Instead of relying on the default being main, which is deprecated. Change-Id: I200e2c2dc922ae1fa5fa68d449403d0287e41786 --- includes/resourceloader/ResourceLoaderContext.php | 4 +++- load.php | 4 +++- maintenance/cleanupRemovedModules.php | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/resourceloader/ResourceLoaderContext.php b/includes/resourceloader/ResourceLoaderContext.php index e79aadcfff..7af7b89865 100644 --- a/includes/resourceloader/ResourceLoaderContext.php +++ b/includes/resourceloader/ResourceLoaderContext.php @@ -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() ) ); } /** diff --git a/load.php b/load.php index 1dd1a8939c..655f3092a5 100644 --- a/load.php +++ b/load.php @@ -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' ); diff --git a/maintenance/cleanupRemovedModules.php b/maintenance/cleanupRemovedModules.php index cc8b02488f..e1d0ed6e5d 100644 --- a/maintenance/cleanupRemovedModules.php +++ b/maintenance/cleanupRemovedModules.php @@ -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 ) ) ); -- 2.20.1