X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcontext%2FDerivativeContext.php;h=e77a058d1d8f9a1b011decbfcfd47ea321efef7f;hb=b3d1931c349314e05c5192a95f6f3250d8183ed0;hp=09c39396966220e03001428f0ec182b1b9b96eac;hpb=0c3f78f5bf1417a8dc1566e7c16dc8166c35074a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/context/DerivativeContext.php b/includes/context/DerivativeContext.php index 09c3939696..e77a058d1d 100644 --- a/includes/context/DerivativeContext.php +++ b/includes/context/DerivativeContext.php @@ -18,6 +18,8 @@ * @author Daniel Friesen * @file */ +use Liuggio\StatsdClient\Factory\StatsdDataFactory; +use MediaWiki\MediaWikiServices; /** * An IContextSource implementation which will inherit context from another source @@ -68,9 +70,9 @@ class DerivativeContext extends ContextSource implements MutableContext { private $config; /** - * @var Stats + * @var Timing */ - private $stats; + private $timing; /** * Constructor @@ -105,13 +107,24 @@ class DerivativeContext extends ContextSource implements MutableContext { /** * Get the stats object * - * @return BufferingStatsdDataFactory + * @deprecated since 1.27 use a StatsdDataFactory from MediaWikiServices (preferably injected) + * + * @return StatsdDataFactory */ public function getStats() { - if ( !is_null( $this->stats ) ) { - return $this->stats; + return MediaWikiServices::getInstance()->getStatsdDataFactory(); + } + + /** + * Get the timing object + * + * @return Timing + */ + public function getTiming() { + if ( !is_null( $this->timing ) ) { + return $this->timing; } else { - return $this->getContext()->getStats(); + return $this->getContext()->getTiming(); } }