dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Move up devunt's name to Developers"
[lhc/web/wiklou.git]
/
includes
/
context
/
DerivativeContext.php
diff --git
a/includes/context/DerivativeContext.php
b/includes/context/DerivativeContext.php
index
09c3939
..
e77a058
100644
(file)
--- a/
includes/context/DerivativeContext.php
+++ b/
includes/context/DerivativeContext.php
@@
-18,6
+18,8
@@
* @author Daniel Friesen
* @file
*/
* @author Daniel Friesen
* @file
*/
+use Liuggio\StatsdClient\Factory\StatsdDataFactory;
+use MediaWiki\MediaWikiServices;
/**
* An IContextSource implementation which will inherit context from another source
/**
* An IContextSource implementation which will inherit context from another source
@@
-68,9
+70,9
@@
class DerivativeContext extends ContextSource implements MutableContext {
private $config;
/**
private $config;
/**
- * @var
Stats
+ * @var
Timing
*/
*/
- private $
stats
;
+ private $
timing
;
/**
* Constructor
/**
* Constructor
@@
-105,13
+107,24
@@
class DerivativeContext extends ContextSource implements MutableContext {
/**
* Get the stats object
*
/**
* Get the stats object
*
- * @return BufferingStatsdDataFactory
+ * @deprecated since 1.27 use a StatsdDataFactory from MediaWikiServices (preferably injected)
+ *
+ * @return StatsdDataFactory
*/
public function getStats() {
*/
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 {
} else {
- return $this->getContext()->get
Stats
();
+ return $this->getContext()->get
Timing
();
}
}
}
}