* @author Daniel Friesen
* @file
*/
+use Liuggio\StatsdClient\Factory\StatsdDataFactory;
+use MediaWiki\MediaWikiServices;
/**
* An IContextSource implementation which will inherit context from another source
* a different Title instance set on it.
* @since 1.19
*/
-class DerivativeContext extends ContextSource {
+class DerivativeContext extends ContextSource implements MutableContext {
/**
* @var WebRequest
*/
private $config;
/**
- * @var Stats
+ * @var Timing
*/
- private $stats;
+ private $timing;
/**
* Constructor
/**
* 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();
}
}