Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepository.php
Show First 20 Lines • Show All 2,103 Lines • ▼ Show 20 Lines | if (!$service) { | ||||
return null; | return null; | ||||
} | } | ||||
$bindings = $service->getActiveBindings(); | $bindings = $service->getActiveBindings(); | ||||
if (!$bindings) { | if (!$bindings) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'The Almanac service for this repository is not bound to any '. | 'The Almanac service for this repository is not bound to any '. | ||||
'interfaces.')); | 'active interfaces.')); | ||||
} | } | ||||
$uris = array(); | $uris = array(); | ||||
foreach ($bindings as $binding) { | foreach ($bindings as $binding) { | ||||
$iface = $binding->getInterface(); | $iface = $binding->getInterface(); | ||||
$uri = $this->getClusterRepositoryURIFromBinding($binding); | $uri = $this->getClusterRepositoryURIFromBinding($binding); | ||||
$protocol = $uri->getProtocol(); | $protocol = $uri->getProtocol(); | ||||
▲ Show 20 Lines • Show All 405 Lines • ▼ Show 20 Lines | public function loadAlmanacService() { | ||||
if (!$service_phid) { | if (!$service_phid) { | ||||
// No service, so this is a local repository. | // No service, so this is a local repository. | ||||
return null; | return null; | ||||
} | } | ||||
$service = id(new AlmanacServiceQuery()) | $service = id(new AlmanacServiceQuery()) | ||||
->setViewer(PhabricatorUser::getOmnipotentUser()) | ->setViewer(PhabricatorUser::getOmnipotentUser()) | ||||
->withPHIDs(array($service_phid)) | ->withPHIDs(array($service_phid)) | ||||
->needBindings(true) | ->needActiveBindings(true) | ||||
->needProperties(true) | ->needProperties(true) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$service) { | if (!$service) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'The Almanac service for this repository is invalid or could not '. | 'The Almanac service for this repository is invalid or could not '. | ||||
'be loaded.')); | 'be loaded.')); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 339 Lines • Show Last 20 Lines |