<?php
/**
- * Request-dependant objects containers.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
*/
private $skin;
+ /**
+ * @var StatsdDataFactory
+ */
+ private $stats;
+
/**
* @var Config
*/
return $this->request;
}
+ /**
+ * Get the Stats object
+ *
+ * @return BufferingStatsdDataFactory
+ */
+ public function getStats() {
+ if ( $this->stats === null ) {
+ $config = $this->getConfig();
+ $prefix = $config->has( 'StatsdMetricPrefix' )
+ ? rtrim( $config->get( 'StatsdMetricPrefix' ), '.' )
+ : 'MediaWiki';
+ $this->stats = new BufferingStatsdDataFactory( $prefix );
+ }
+ return $this->stats;
+ }
+
/**
* Set the Title object
*
*/
public function getSkin() {
if ( $this->skin === null ) {
- wfProfileIn( __METHOD__ . '-createskin' );
$skin = null;
Hooks::run( 'RequestContextCreateSkin', array( $this, &$skin ) );
// After all that set a context on whatever skin got created
$this->skin->setContext( $this );
- wfProfileOut( __METHOD__ . '-createskin' );
}
return $this->skin;