MediaWiki  master
ProfilerOutput.php
Go to the documentation of this file.
1 <?php
22 use Psr\Log\LoggerInterface;
23 
30 abstract class ProfilerOutput {
32  protected $collector;
34  protected $logger;
36  protected $params;
37 
42  public function __construct( Profiler $collector, array $params ) {
43  $this->collector = $collector;
44  $this->params = $params;
45  $this->logger = LoggerFactory::getInstance( 'profiler' );
46  }
47 
52  public function canUse() {
53  return true;
54  }
55 
61  public function logsToOutput() {
62  return false;
63  }
64 
73  abstract public function log( array $stats );
74 }
ProfilerOutput\logsToOutput
logsToOutput()
May the log() try to write to standard output?
Definition: ProfilerOutput.php:61
ProfilerOutput\$collector
Profiler $collector
Definition: ProfilerOutput.php:32
ProfilerOutput\$logger
LoggerInterface $logger
Definition: ProfilerOutput.php:34
ProfilerOutput\$params
array $params
Configuration of $wgProfiler.
Definition: ProfilerOutput.php:36
MediaWiki\Logger\LoggerFactory
PSR-3 logger instance factory.
Definition: LoggerFactory.php:45
Profiler
Profiler base class that defines the interface and some shared functionality.
Definition: Profiler.php:36
ProfilerOutput\__construct
__construct(Profiler $collector, array $params)
Definition: ProfilerOutput.php:42
ProfilerOutput\log
log(array $stats)
Log MediaWiki-style profiling data.
ProfilerOutput\canUse
canUse()
Can this output type be used?
Definition: ProfilerOutput.php:52
ProfilerOutput
Base class for profiling output.
Definition: ProfilerOutput.php:30