resourceloader: Unbreak ResourceLoaderImageModule's rasterization
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderContext.php
index a6a7d34..cee7035 100644 (file)
@@ -22,6 +22,8 @@
  * @author Roan Kattouw
  */
 
+use MediaWiki\Logger\LoggerFactory;
+
 /**
  * Object passed around to modules which contains information about the state
  * of a specific loader request
@@ -123,7 +125,8 @@ class ResourceLoaderContext {
         */
        public static function newDummyContext() {
                return new self( new ResourceLoader(
-                       ConfigFactory::getDefaultInstance()->makeConfig( 'main' )
+                       ConfigFactory::getDefaultInstance()->makeConfig( 'main' ),
+                       LoggerFactory::getInstance( 'resourceloader' )
                ), new FauxRequest( array() ) );
        }
 
@@ -227,6 +230,8 @@ class ResourceLoaderContext {
        }
 
        /**
+        * @see ResourceLoaderModule::getVersionHash
+        * @see OutputPage::makeResourceLoaderLink
         * @return string|null
         */
        public function getVersion() {
@@ -285,7 +290,7 @@ class ResourceLoaderContext {
                                return $this->imageObj;
                        }
 
-                       $image = $module->getImage( $this->image );
+                       $image = $module->getImage( $this->image, $this );
                        if ( !$image ) {
                                return $this->imageObj;
                        }
@@ -314,7 +319,7 @@ class ResourceLoaderContext {
         * @return bool
         */
        public function shouldIncludeMessages() {
-               return is_null( $this->getOnly() ) || $this->getOnly() === 'messages';
+               return is_null( $this->getOnly() );
        }
 
        /**