Ensure logo preload transforms urls if needed
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderModule.php
index 6d2bc0d..5404e0f 100644 (file)
@@ -147,8 +147,8 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
                if ( $deprecationInfo ) {
                        $name = $this->getName();
                        $warning = 'This page is using the deprecated ResourceLoader module "' . $name . '".';
-                       if ( !is_bool( $deprecationInfo ) && isset( $deprecationInfo['message'] ) ) {
-                               $warning .= "\n" . $deprecationInfo['message'];
+                       if ( is_string( $deprecationInfo ) ) {
+                               $warning .= "\n" . $deprecationInfo;
                        }
                        return Xml::encodeJsCall(
                                'mw.log.warn',
@@ -624,7 +624,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
         */
        final protected function buildContent( ResourceLoaderContext $context ) {
                $rl = $context->getResourceLoader();
-               $stats = RequestContext::getMain()->getStats();
+               $stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
                $statStart = microtime( true );
 
                // Only include properties that are relevant to this context (e.g. only=scripts)
@@ -651,7 +651,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
                                        && substr( rtrim( $scripts ), -1 ) !== ';'
                                ) {
                                        // Append semicolon to prevent weird bugs caused by files not
-                                       // terminating their statements right (bug 27054)
+                                       // terminating their statements right (T29054)
                                        $scripts .= ";\n";
                                }
                        }
@@ -662,7 +662,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
                if ( $context->shouldIncludeStyles() ) {
                        $styles = [];
                        // Don't create empty stylesheets like [ '' => '' ] for modules
-                       // that don't *have* any stylesheets (bug 38024).
+                       // that don't *have* any stylesheets (T40024).
                        $stylePairs = $this->getStyles( $context );
                        if ( count( $stylePairs ) ) {
                                // If we are in debug mode without &only= set, we'll want to return an array of URLs
@@ -843,7 +843,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
         */
        public function getDefinitionSummary( ResourceLoaderContext $context ) {
                return [
-                       '_class' => get_class( $this ),
+                       '_class' => static::class,
                        '_cacheEpoch' => $this->getConfig()->get( 'CacheEpoch' ),
                ];
        }