Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / daemon / management / PhabricatorDaemonManagementStatusWorkflow.php
blobd5af149869aa2069c96ffcc50649b18b0512614e
1 <?php
3 final class PhabricatorDaemonManagementStatusWorkflow
4 extends PhabricatorDaemonManagementWorkflow {
6 protected function didConstruct() {
7 $this
8 ->setName('status')
9 ->setSynopsis(pht('Show daemon processes on this host.'));
12 public function execute(PhutilArgumentParser $args) {
13 $process_refs = $this->getOverseerProcessRefs();
15 if (!$process_refs) {
16 $instance = $this->getInstance();
17 if ($instance !== null) {
18 $this->logInfo(
19 pht('NO DAEMONS'),
20 pht(
21 'There are no running daemon processes for the current '.
22 'instance ("%s").',
23 $instance));
24 } else {
25 $this->logInfo(
26 pht('NO DAEMONS'),
27 pht('There are no running daemon processes.'));
30 return 1;
33 $table = id(new PhutilConsoleTable())
34 ->addColumns(
35 array(
36 'pid' => array(
37 'title' => pht('PID'),
39 'command' => array(
40 'title' => pht('Command'),
42 ));
44 foreach ($process_refs as $process_ref) {
45 $table->addRow(
46 array(
47 'pid' => $process_ref->getPID(),
48 'command' => $process_ref->getCommand(),
49 ));
52 $table->draw();
54 return 0;