Differential D21875 Diff 52184 src/applications/notification/client/PhabricatorNotificationServerRef.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/notification/client/PhabricatorNotificationServerRef.php
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | final class PhabricatorNotificationServerRef | ||||
public function isAdminServer() { | public function isAdminServer() { | ||||
return ($this->type == 'admin'); | return ($this->type == 'admin'); | ||||
} | } | ||||
public function getURI($to_path = null) { | public function getURI($to_path = null) { | ||||
if ($to_path === null || !strlen($to_path)) { | if ($to_path === null || !strlen($to_path)) { | ||||
$to_path = ''; | $to_path = ''; | ||||
} else { | } else { | ||||
$to_path = '/'.ltrim($to_path, '/'); | $to_path = ltrim($to_path, '/'); | ||||
} | } | ||||
$base_path = $this->getPath(); | $base_path = $this->getPath(); | ||||
if ($base_path === null || !strlen($base_path)) { | if ($base_path === null || !strlen($base_path)) { | ||||
$base_path = ''; | $base_path = ''; | ||||
} else { | } else { | ||||
$base_path = rtrim($base_path, '/'); | $base_path = rtrim($base_path, '/'); | ||||
} | } | ||||
$full_path = $base_path.$to_path; | $full_path = $base_path.'/'.$to_path; | ||||
$uri = id(new PhutilURI('http://'.$this->getHost())) | $uri = id(new PhutilURI('http://'.$this->getHost())) | ||||
->setProtocol($this->getProtocol()) | ->setProtocol($this->getProtocol()) | ||||
->setPort($this->getPort()) | ->setPort($this->getPort()) | ||||
->setPath($full_path); | ->setPath($full_path); | ||||
$instance = PhabricatorEnv::getEnvConfig('cluster.instance'); | $instance = PhabricatorEnv::getEnvConfig('cluster.instance'); | ||||
if ($instance !== null && strlen($instance)) { | if ($instance !== null && strlen($instance)) { | ||||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |