Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F113131536
PhabricatorDaemonManagementStatusWorkflow.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
Thu, May 15, 09:12
Size
1 KB
Mime Type
text/x-php
Expires
Sat, May 17, 09:12 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
26156364
Attached To
rPH Phabricator
PhabricatorDaemonManagementStatusWorkflow.php
View Options
<?php
final
class
PhabricatorDaemonManagementStatusWorkflow
extends
PhabricatorDaemonManagementWorkflow
{
public
function
didConstruct
()
{
$this
->
setName
(
'status'
)
->
setSynopsis
(
pht
(
'Show status of running daemons.'
))
->
setArguments
(
array
());
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$console
=
PhutilConsole
::
getConsole
();
$daemons
=
$this
->
loadRunningDaemons
();
if
(!
$daemons
)
{
$console
->
writeErr
(
"%s
\n
"
,
pht
(
"There are no running Phabricator daemons."
));
return
1
;
}
$status
=
0
;
printf
(
"%-5s
\t
%-24s
\t
%s
\n
"
,
"PID"
,
"Started"
,
"Daemon"
);
foreach
(
$daemons
as
$daemon
)
{
$name
=
$daemon
->
getName
();
if
(!
$daemon
->
isRunning
())
{
$daemon
->
updateStatus
(
PhabricatorDaemonLog
::
STATUS_DEAD
);
$status
=
2
;
$name
=
'<DEAD> '
.
$name
;
}
printf
(
"%5s
\t
%-24s
\t
%s
\n
"
,
$daemon
->
getPID
(),
$daemon
->
getEpochStarted
()
?
date
(
'M j Y, g:i:s A'
,
$daemon
->
getEpochStarted
())
:
null
,
$name
);
}
return
$status
;
}
}
Event Timeline
Log In to Comment