MediaWiki  1.34.0
ProfilerOutputDump.php
Go to the documentation of this file.
1 <?php
32 
33  protected $suffix = ".xhprof";
34 
40  public function canUse() {
41  if ( empty( $this->params['outputDir'] ) ) {
42  return false;
43  }
44  return true;
45  }
46 
47  public function log( array $stats ) {
48  $data = $this->collector->getRawData();
49  $filename = sprintf( "%s/%s.%s%s",
50  $this->params['outputDir'],
51  uniqid(),
52  $this->collector->getProfileID(),
53  $this->suffix );
54  file_put_contents( $filename, serialize( $data ) );
55  }
56 }
ProfilerOutputDump\$suffix
$suffix
Definition: ProfilerOutputDump.php:33
serialize
serialize()
Definition: ApiMessageTrait.php:138
ProfilerOutputDump\log
log(array $stats)
Log MediaWiki-style profiling data.
Definition: ProfilerOutputDump.php:47
ProfilerOutput
Base class for profiling output.
Definition: ProfilerOutput.php:27
ProfilerOutputDump
Definition: ProfilerOutputDump.php:31
ProfilerOutputDump\canUse
canUse()
Can this output type be used?
Definition: ProfilerOutputDump.php:40