Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F112665369
PhabricatorManagementWorkflow.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, May 12, 03:07
Size
1 KB
Mime Type
text/x-php
Expires
Wed, May 14, 03:07 (2 d)
Engine
blob
Format
Raw Data
Handle
26123385
Attached To
rPH Phabricator
PhabricatorManagementWorkflow.php
View Options
<?php
abstract
class
PhabricatorManagementWorkflow
extends
PhutilArgumentWorkflow
{
public
function
isExecutable
()
{
return
true
;
}
public
function
getViewer
()
{
// Some day, we might provide a more general viewer mechanism to scripts.
// For now, workflows can call this method for convenience and future
// flexibility.
return
PhabricatorUser
::
getOmnipotentUser
();
}
protected
function
parseTimeArgument
(
$time
)
{
if
(!
strlen
(
$time
))
{
return
null
;
}
$epoch
=
strtotime
(
$time
);
if
(
$epoch
<=
0
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Unable to parse time "%s".'
,
$time
));
}
return
$epoch
;
}
protected
function
newContentSource
()
{
return
PhabricatorContentSource
::
newForSource
(
PhabricatorConsoleContentSource
::
SOURCECONST
);
}
protected
function
logInfo
(
$label
,
$message
)
{
$this
->
logRaw
(
tsprintf
(
"**<bg:blue> %s </bg>** %s
\n
"
,
$label
,
$message
));
}
protected
function
logOkay
(
$label
,
$message
)
{
$this
->
logRaw
(
tsprintf
(
"**<bg:green> %s </bg>** %s
\n
"
,
$label
,
$message
));
}
protected
function
logWarn
(
$label
,
$message
)
{
$this
->
logRaw
(
tsprintf
(
"**<bg:yellow> %s </bg>** %s
\n
"
,
$label
,
$message
));
}
protected
function
logFail
(
$label
,
$message
)
{
$this
->
logRaw
(
tsprintf
(
"**<bg:red> %s </bg>** %s
\n
"
,
$label
,
$message
));
}
private
function
logRaw
(
$message
)
{
fprintf
(
STDERR
,
'%s'
,
$message
);
}
}
Event Timeline
Log In to Comment