Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F549101
PhabricatorXHProfSample.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorXHProfSample.php
View Options
<?php
final
class
PhabricatorXHProfSample
extends
PhabricatorXHProfDAO
implements
PhabricatorPolicyInterface
{
protected
$filePHID
;
protected
$usTotal
;
protected
$sampleRate
;
protected
$hostname
;
protected
$requestPath
;
protected
$controller
;
protected
$userPHID
;
public
static
function
initializeNewSample
()
{
return
id
(
new
self
())
->
setUsTotal
(
0
)
->
setSampleRate
(
0
);
}
protected
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_COLUMN_SCHEMA
=>
array
(
'sampleRate'
=>
'uint32'
,
'usTotal'
=>
'uint64'
,
'hostname'
=>
'text255?'
,
'requestPath'
=>
'text255?'
,
'controller'
=>
'text255?'
,
'userPHID'
=>
'phid?'
,
),
self
::
CONFIG_KEY_SCHEMA
=>
array
(
'filePHID'
=>
array
(
'columns'
=>
array
(
'filePHID'
),
'unique'
=>
true
,
),
),
)
+
parent
::
getConfiguration
();
}
public
function
getURI
()
{
return
'/xhprof/profile/'
.
$this
->
getFilePHID
().
'/'
;
}
public
function
getDisplayName
()
{
$request_path
=
$this
->
getRequestPath
();
if
(
strlen
(
$request_path
))
{
return
$request_path
;
}
return
pht
(
'Unnamed Sample'
);
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public
function
getCapabilities
()
{
return
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
);
}
public
function
getPolicy
(
$capability
)
{
switch
(
$capability
)
{
case
PhabricatorPolicyCapability
::
CAN_VIEW
:
return
PhabricatorPolicies
::
getMostOpenPolicy
();
}
}
public
function
hasAutomaticCapability
(
$capability
,
PhabricatorUser
$viewer
)
{
return
false
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 2:01 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
98412
Default Alt Text
PhabricatorXHProfSample.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment