@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhabricatorDaemonManagementStatusWorkflow
4 extends PhabricatorDaemonManagementWorkflow {
5
6 protected function didConstruct() {
7 $this
8 ->setName('status')
9 ->setSynopsis(pht('Show daemon processes on this host.'));
10 }
11
12 public function execute(PhutilArgumentParser $args) {
13 $process_refs = $this->getOverseerProcessRefs();
14
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.'));
28 }
29
30 return 1;
31 }
32
33 $table = id(new PhutilConsoleTable())
34 ->addColumns(
35 array(
36 'pid' => array(
37 'title' => pht('PID'),
38 ),
39 'command' => array(
40 'title' => pht('Command'),
41 ),
42 ));
43
44 foreach ($process_refs as $process_ref) {
45 $table->addRow(
46 array(
47 'pid' => $process_ref->getPID(),
48 'command' => $process_ref->getCommand(),
49 ));
50 }
51
52 $table->draw();
53
54 return 0;
55 }
56
57}