@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 PhabricatorDaemonLog extends PhabricatorDaemonDAO
4 implements PhabricatorPolicyInterface {
5
6 const STATUS_UNKNOWN = 'unknown';
7 const STATUS_RUNNING = 'run';
8 const STATUS_DEAD = 'dead';
9 const STATUS_WAIT = 'wait';
10 const STATUS_EXITING = 'exiting';
11 const STATUS_EXITED = 'exit';
12
13 protected $daemon;
14 protected $host;
15 protected $pid;
16 protected $daemonID;
17 protected $runningAsUser;
18 protected $argv;
19 protected $explicitArgv = array();
20 protected $status;
21
22 protected function getConfiguration() {
23 return array(
24 self::CONFIG_SERIALIZATION => array(
25 'argv' => self::SERIALIZATION_JSON,
26 'explicitArgv' => self::SERIALIZATION_JSON,
27 ),
28 self::CONFIG_COLUMN_SCHEMA => array(
29 'daemon' => 'text255',
30 'host' => 'text255',
31 'pid' => 'uint32',
32 'runningAsUser' => 'text255?',
33 'status' => 'text8',
34 'daemonID' => 'text64',
35 ),
36 self::CONFIG_KEY_SCHEMA => array(
37 'status' => array(
38 'columns' => array('status'),
39 ),
40 'key_daemonID' => array(
41 'columns' => array('daemonID'),
42 'unique' => true,
43 ),
44 'key_modified' => array(
45 'columns' => array('dateModified'),
46 ),
47 ),
48 ) + parent::getConfiguration();
49 }
50
51 public function getExplicitArgv() {
52 $argv = $this->explicitArgv;
53 if (!is_array($argv)) {
54 return array();
55 }
56 return $argv;
57 }
58
59
60/* -( PhabricatorPolicyInterface )----------------------------------------- */
61
62 public function getPHID() {
63 return null;
64 }
65
66 public function getCapabilities() {
67 return array(
68 PhabricatorPolicyCapability::CAN_VIEW,
69 );
70 }
71
72 public function getPolicy($capability) {
73 return PhabricatorPolicies::POLICY_ADMIN;
74 }
75
76 public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
77 return false;
78 }
79
80}