Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / repository / storage / PhabricatorRepositoryStatusMessage.php
bloba9a1b1ae8cc5c261faa686a3f6f30250e863ca45
1 <?php
3 final class PhabricatorRepositoryStatusMessage
4 extends PhabricatorRepositoryDAO {
6 const TYPE_INIT = 'init';
7 const TYPE_FETCH = 'fetch';
8 const TYPE_NEEDS_UPDATE = 'needs-update';
10 const CODE_ERROR = 'error';
11 const CODE_OKAY = 'okay';
13 protected $repositoryID;
14 protected $statusType;
15 protected $statusCode;
16 protected $parameters = array();
17 protected $epoch;
18 protected $messageCount;
20 protected function getConfiguration() {
21 return array(
22 self::CONFIG_TIMESTAMPS => false,
23 self::CONFIG_SERIALIZATION => array(
24 'parameters' => self::SERIALIZATION_JSON,
26 self::CONFIG_COLUMN_SCHEMA => array(
27 'statusType' => 'text32',
28 'statusCode' => 'text32',
29 'messageCount' => 'uint32',
31 self::CONFIG_KEY_SCHEMA => array(
32 'repositoryID' => array(
33 'columns' => array('repositoryID', 'statusType'),
34 'unique' => true,
37 ) + parent::getConfiguration();
40 public function getParameter($key, $default = null) {
41 return idx($this->parameters, $key, $default);
44 public function getStatusTypeName() {
45 $names = array(
46 self::TYPE_INIT => pht('Error While Initializing Repository'),
47 self::TYPE_FETCH => pht('Error While Fetching Changes'),
48 self::TYPE_NEEDS_UPDATE => pht('Repository Needs Update'),
51 $type = $this->getStatusType();
52 return idx($names, $type, $type);