Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F568472
PhabricatorSystemAction.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
PhabricatorSystemAction.php
View Options
<?php
abstract
class
PhabricatorSystemAction
extends
Phobject
{
final
public
function
getActionConstant
()
{
return
$this
->
getPhobjectClassConstant
(
'TYPECONST'
,
32
);
}
abstract
public
function
getScoreThreshold
();
public
function
shouldBlockActor
(
$actor
,
$score
)
{
return
(
$score
>
$this
->
getScoreThreshold
());
}
public
function
getLimitExplanation
()
{
return
pht
(
'You are performing too many actions too quickly.'
);
}
public
function
getRateExplanation
(
$score
)
{
return
pht
(
'The maximum allowed rate for this action is %s. You are taking '
.
'actions at a rate of %s.'
,
$this
->
formatRate
(
$this
->
getScoreThreshold
()),
$this
->
formatRate
(
$score
));
}
protected
function
formatRate
(
$rate
)
{
if
(
$rate
>
10
)
{
$str
=
pht
(
'%d / second'
,
$rate
);
}
else
{
$rate
*=
60
;
if
(
$rate
>
10
)
{
$str
=
pht
(
'%d / minute'
,
$rate
);
}
else
{
$rate
*=
60
;
$str
=
pht
(
'%d / hour'
,
$rate
);
}
}
return
phutil_tag
(
'strong'
,
array
(),
$str
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 13, 1:28 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
124551
Default Alt Text
PhabricatorSystemAction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment