From d79eac20f3adceef9aa5760410f2629ff17003c7 Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Wed, 29 Sep 2010 21:13:56 +0000 Subject: [PATCH] Fixed a use of ResourceLoader::getModule as a static method when converting things over in r73971. --- includes/MessageBlobStore.php | 8 ++++---- includes/ResourceLoader.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/MessageBlobStore.php b/includes/MessageBlobStore.php index 604b1d4638..ecb97503af 100644 --- a/includes/MessageBlobStore.php +++ b/includes/MessageBlobStore.php @@ -35,7 +35,7 @@ class MessageBlobStore { * @param $lang string Language code * @return array An array mapping module names to message blobs */ - public static function get( $modules, $lang ) { + public static function get( ResourceLoader $resourceLoader, $modules, $lang ) { // TODO: Invalidate blob when module touched wfProfileIn( __METHOD__ ); if ( !count( $modules ) ) { @@ -43,7 +43,7 @@ class MessageBlobStore { return array(); } // Try getting from the DB first - $blobs = self::getFromDB( array_keys( $modules ), $lang ); + $blobs = self::getFromDB( $resourceLoader, array_keys( $modules ), $lang ); // Generate blobs for any missing modules and store them in the DB $missing = array_diff( array_keys( $modules ), array_keys( $blobs ) ); @@ -311,7 +311,7 @@ class MessageBlobStore { * @param $lang string Language code * @return array Array mapping module names to blobs */ - private static function getFromDB( $modules, $lang ) { + private static function getFromDB( ResourceLoader $resourceLoader, $modules, $lang ) { $retval = array(); $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'msg_resource', @@ -321,7 +321,7 @@ class MessageBlobStore { ); foreach ( $res as $row ) { - $module = ResourceLoader::getModule( $row->mr_resource ); + $module = $resourceLoader->getModule( $row->mr_resource ); if ( !$module ) { // This shouldn't be possible throw new MWException( __METHOD__ . ' passed an invalid module name' ); diff --git a/includes/ResourceLoader.php b/includes/ResourceLoader.php index 1f2538bd8e..4cd1d96b9c 100644 --- a/includes/ResourceLoader.php +++ b/includes/ResourceLoader.php @@ -299,7 +299,7 @@ class ResourceLoader { public function makeModuleResponse( ResourceLoaderContext $context, array $modules, $missing = null ) { // Pre-fetch blobs $blobs = $context->shouldIncludeMessages() ? - MessageBlobStore::get( $modules, $context->getLanguage() ) : array(); + MessageBlobStore::get( $this, $modules, $context->getLanguage() ) : array(); // Generate output $out = ''; -- 2.20.1