http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73984
Revision: 73984
Author: tparscal
Date: 2010-09-29 21:13:56 +0000 (Wed, 29 Sep 2010)
Log Message:
-----------
Fixed a use of ResourceLoader::getModule as a static method when converting
things over in r73971.
Modified Paths:
--------------
trunk/phase3/includes/MessageBlobStore.php
trunk/phase3/includes/ResourceLoader.php
Modified: trunk/phase3/includes/MessageBlobStore.php
===================================================================
--- trunk/phase3/includes/MessageBlobStore.php 2010-09-29 21:12:56 UTC (rev
73983)
+++ trunk/phase3/includes/MessageBlobStore.php 2010-09-29 21:13:56 UTC (rev
73984)
@@ -35,7 +35,7 @@
* @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 @@
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 @@
* @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 @@
);
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' );
Modified: trunk/phase3/includes/ResourceLoader.php
===================================================================
--- trunk/phase3/includes/ResourceLoader.php 2010-09-29 21:12:56 UTC (rev
73983)
+++ trunk/phase3/includes/ResourceLoader.php 2010-09-29 21:13:56 UTC (rev
73984)
@@ -299,7 +299,7 @@
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 = '';
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs