From: Trevor Parscal Date: Wed, 29 Sep 2010 21:13:56 +0000 (+0000) Subject: Fixed a use of ResourceLoader::getModule as a static method when converting things... X-Git-Tag: 1.31.0-rc.0~34733 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=d79eac20f3adceef9aa5760410f2629ff17003c7;p=lhc%2Fweb%2Fwiklou.git Fixed a use of ResourceLoader::getModule as a static method when converting things over in r73971. --- 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 = '';