Page MenuHomeWickedGov Phorge

ProfilerOutputDump.php
No OneTemporary

Size
856 B
Referenced Files
None
Subscribers
None

ProfilerOutputDump.php

<?php
/**
* @license GPL-2.0-or-later
* @file
*/
/**
* Dump profiler data in a ".xhprof" file.
*
* @ingroup Profiler
* @since 1.25
*/
class ProfilerOutputDump extends ProfilerOutput {
/** @var string */
protected $suffix = ".xhprof";
/**
* Can this output type be used?
*
* @return bool
*/
public function canUse() {
if ( empty( $this->params['outputDir'] ) ) {
return false;
}
return true;
}
public function log( array $stats ) {
if ( !$this->collector instanceof ProfilerXhprof ) {
$this->logger->error( 'ProfilerOutputDump must be used with ProfilerXhprof' );
return;
}
$data = $this->collector->getRawData();
$filename = sprintf( "%s/%s.%s%s",
$this->params['outputDir'],
uniqid(),
$this->collector->getProfileID(),
$this->suffix );
file_put_contents( $filename, serialize( $data ) );
}
}

File Metadata

Mime Type
text/x-php
Expires
Tue, Aug 18, 17:11 (3 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
4f/4d/2af9c1b59fe9731b9e6b64b0e650
Default Alt Text
ProfilerOutputDump.php (856 B)

Event Timeline