Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/site/PhabricatorShortSite.php
<?php | <?php | ||||
final class PhabricatorShortSite extends PhabricatorSite { | final class PhabricatorShortSite extends PhabricatorSite { | ||||
public function getDescription() { | public function getDescription() { | ||||
return pht('Serves shortened URLs.'); | return pht('Serves shortened URLs.'); | ||||
} | } | ||||
public function getPriority() { | public function getPriority() { | ||||
return 2500; | return 2500; | ||||
} | } | ||||
public function newSiteForRequest(AphrontRequest $request) { | public function newSiteForRequest(AphrontRequest $request) { | ||||
$host = $request->getHost(); | $host = $request->getHost(); | ||||
$uri = PhabricatorEnv::getEnvConfig('phurl.short-uri'); | $uri = PhabricatorEnv::getEnvConfig('phurl.short-uri'); | ||||
if (!strlen($uri)) { | if (!phutil_nonempty_string($uri)) { | ||||
return null; | return null; | ||||
} | } | ||||
$phurl_installed = PhabricatorApplication::isClassInstalled( | $phurl_installed = PhabricatorApplication::isClassInstalled( | ||||
'PhabricatorPhurlApplication'); | 'PhabricatorPhurlApplication'); | ||||
if (!$phurl_installed) { | if (!$phurl_installed) { | ||||
return false; | return false; | ||||
} | } | ||||
Show All 19 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0