Get StatsdDataFactory from MediaWikiServices
authorWMDE-Fisch <christoph.jauera@wikimedia.de>
Fri, 11 Nov 2016 16:48:02 +0000 (17:48 +0100)
committerWMDE-Fisch <christoph.jauera@wikimedia.de>
Fri, 11 Nov 2016 16:55:28 +0000 (17:55 +0100)
Change-Id: Ia4a32e7932299168649b6472f503249630fd7c1e

includes/EditPage.php

index ca14864..5b0bc8a 100644 (file)
@@ -3534,7 +3534,7 @@ HTML
                global $wgOut;
 
                if ( Hooks::run( 'EditPageBeforeConflictDiff', [ &$this, &$wgOut ] ) ) {
-                       $stats = $wgOut->getContext()->getStats();
+                       $stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
                        $stats->increment( 'edit.failures.conflict' );
                        // Only include 'standard' namespaces to avoid creating unknown numbers of statsd metrics
                        if (
@@ -3673,7 +3673,7 @@ HTML
                global $wgOut, $wgRawHtml, $wgLang;
                global $wgAllowUserCss, $wgAllowUserJs;
 
-               $stats = $wgOut->getContext()->getStats();
+               $stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
 
                if ( $wgRawHtml && !$this->mTokenOk ) {
                        // Could be an offsite preview attempt. This is very unsafe if