Merge "Replace deprecated Context::getStats() with MWServices::getStatsdDataFactory()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 20 Mar 2017 09:32:47 +0000 (09:32 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 20 Mar 2017 09:32:48 +0000 (09:32 +0000)
1  2 
includes/resourceloader/ResourceLoaderModule.php

@@@ -147,8 -147,8 +147,8 @@@ abstract class ResourceLoaderModule imp
                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',
         */
        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)