Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/site/PhabricatorPlatformSite.php
<?php | <?php | ||||
final class PhabricatorPlatformSite extends PhabricatorSite { | final class PhabricatorPlatformSite extends PhabricatorSite { | ||||
public function getDescription() { | public function getDescription() { | ||||
return pht('Serves the core platform and applications.'); | return pht('Serves the core platform and applications.'); | ||||
} | } | ||||
public function getPriority() { | public function getPriority() { | ||||
return 1000; | return 1000; | ||||
} | } | ||||
public function newSiteForRequest(AphrontRequest $request) { | public function newSiteForRequest(AphrontRequest $request) { | ||||
// If no base URI has been configured yet, match this site so the user | |||||
// can follow setup instructions. | |||||
$base_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri'); | |||||
if (!strlen($base_uri)) { | |||||
return new PhabricatorPlatformSite(); | |||||
} | |||||
$uris = array(); | $uris = array(); | ||||
$uris[] = PhabricatorEnv::getEnvConfig('phabricator.base-uri'); | $uris[] = $base_uri; | ||||
$uris[] = PhabricatorEnv::getEnvConfig('phabricator.production-uri'); | $uris[] = PhabricatorEnv::getEnvConfig('phabricator.production-uri'); | ||||
$allowed = PhabricatorEnv::getEnvConfig('phabricator.allowed-uris'); | $allowed = PhabricatorEnv::getEnvConfig('phabricator.allowed-uris'); | ||||
if ($allowed) { | if ($allowed) { | ||||
foreach ($allowed as $uri) { | foreach ($allowed as $uri) { | ||||
$uris[] = $uri; | $uris[] = $uri; | ||||
} | } | ||||
} | } | ||||
Show All 10 Lines |