X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcontext%2FDerivativeContext.php;h=e77a058d1d8f9a1b011decbfcfd47ea321efef7f;hb=2ffff73a46c29cdad1cbf59063f4dd75debd3b4c;hp=09c39396966220e03001428f0ec182b1b9b96eac;hpb=f318d7a04b2d8251c04e1e0cb3ed33db0d7199ad;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(); } }