Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4101931
ProfilerOutputDump.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
856 B
Referenced Files
None
Subscribers
None
ProfilerOutputDump.php
View Options
<?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
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 17:11 (3 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
4f/4d/2af9c1b59fe9731b9e6b64b0e650
Default Alt Text
ProfilerOutputDump.php (856 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment