mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-07 21:31:02 +01:00
706c21375e
Summary: This has been replaced by `PolicyCodex` after D16830. Also: - Rebuild Celerity map to fix grumpy unit test. - Fix one issue on the policy exception workflow to accommodate the new code. Test Plan: - `arc unit --everything` - Viewed policy explanations. - Viewed policy errors. Reviewers: chad Reviewed By: chad Subscribers: hach-que, PHID-OPKG-gm6ozazyms6q6i22gyam Differential Revision: https://secure.phabricator.com/D16831
80 lines
1.9 KiB
PHP
80 lines
1.9 KiB
PHP
<?php
|
|
|
|
final class PhabricatorDaemonLog extends PhabricatorDaemonDAO
|
|
implements PhabricatorPolicyInterface {
|
|
|
|
const STATUS_UNKNOWN = 'unknown';
|
|
const STATUS_RUNNING = 'run';
|
|
const STATUS_DEAD = 'dead';
|
|
const STATUS_WAIT = 'wait';
|
|
const STATUS_EXITING = 'exiting';
|
|
const STATUS_EXITED = 'exit';
|
|
|
|
protected $daemon;
|
|
protected $host;
|
|
protected $pid;
|
|
protected $daemonID;
|
|
protected $runningAsUser;
|
|
protected $argv;
|
|
protected $explicitArgv = array();
|
|
protected $status;
|
|
|
|
protected function getConfiguration() {
|
|
return array(
|
|
self::CONFIG_SERIALIZATION => array(
|
|
'argv' => self::SERIALIZATION_JSON,
|
|
'explicitArgv' => self::SERIALIZATION_JSON,
|
|
),
|
|
self::CONFIG_COLUMN_SCHEMA => array(
|
|
'daemon' => 'text255',
|
|
'host' => 'text255',
|
|
'pid' => 'uint32',
|
|
'runningAsUser' => 'text255?',
|
|
'status' => 'text8',
|
|
'daemonID' => 'text64',
|
|
),
|
|
self::CONFIG_KEY_SCHEMA => array(
|
|
'status' => array(
|
|
'columns' => array('status'),
|
|
),
|
|
'dateCreated' => array(
|
|
'columns' => array('dateCreated'),
|
|
),
|
|
'key_daemonID' => array(
|
|
'columns' => array('daemonID'),
|
|
'unique' => true,
|
|
),
|
|
),
|
|
) + parent::getConfiguration();
|
|
}
|
|
|
|
public function getExplicitArgv() {
|
|
$argv = $this->explicitArgv;
|
|
if (!is_array($argv)) {
|
|
return array();
|
|
}
|
|
return $argv;
|
|
}
|
|
|
|
|
|
/* -( PhabricatorPolicyInterface )----------------------------------------- */
|
|
|
|
public function getPHID() {
|
|
return null;
|
|
}
|
|
|
|
public function getCapabilities() {
|
|
return array(
|
|
PhabricatorPolicyCapability::CAN_VIEW,
|
|
);
|
|
}
|
|
|
|
public function getPolicy($capability) {
|
|
return PhabricatorPolicies::POLICY_ADMIN;
|
|
}
|
|
|
|
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
|
|
return false;
|
|
}
|
|
|
|
}
|