Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/cluster/PhabricatorClusterRef.php
- This file was added.
<?php | |||||
abstract class PhabricatorClusterRef | |||||
extends Phobject { | |||||
protected $disabled; | |||||
protected $host; | |||||
protected $port; | |||||
const STATUS_OKAY = 'okay'; | |||||
const STATUS_FAIL = 'fail'; | |||||
const STATUS_AUTH = 'auth'; | |||||
const STATUS_REPLICATION_CLIENT = 'replication-client'; | |||||
const KEY_REFS = 'cluster.refs'; | |||||
public function setDisabled($is_disabled) { | |||||
$this->disabled = $is_disabled; | |||||
return $this; | |||||
} | |||||
public function getDisabled() { | |||||
return $this->disabled; | |||||
} | |||||
public function setHost($host) { | |||||
$this->host = $host; | |||||
return $this; | |||||
} | |||||
public function getHost() { | |||||
return $this->host; | |||||
} | |||||
public function setPort($port) { | |||||
$this->port = $port; | |||||
return $this; | |||||
} | |||||
public function getPort() { | |||||
return $this->port; | |||||
} | |||||
public static function getConnectionStatusMap() { | |||||
return array( | |||||
self::STATUS_OKAY => array( | |||||
'icon' => 'fa-exchange', | |||||
'color' => 'green', | |||||
'label' => pht('Okay'), | |||||
), | |||||
self::STATUS_FAIL => array( | |||||
'icon' => 'fa-times', | |||||
'color' => 'red', | |||||
'label' => pht('Failed'), | |||||
), | |||||
self::STATUS_AUTH => array( | |||||
'icon' => 'fa-key', | |||||
'color' => 'red', | |||||
'label' => pht('Invalid Credentials'), | |||||
), | |||||
self::STATUS_REPLICATION_CLIENT => array( | |||||
'icon' => 'fa-eye-slash', | |||||
'color' => 'yellow', | |||||
'label' => pht('Missing Permission'), | |||||
), | |||||
); | |||||
} | |||||
} |