Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/aphront/site/PhabricatorResourceSite.php
13418 views
1
<?php
2
3
final class PhabricatorResourceSite extends PhabricatorSite {
4
5
public function getDescription() {
6
return pht('Serves static resources like images, CSS and JS.');
7
}
8
9
public function getPriority() {
10
return 2000;
11
}
12
13
public function newSiteForRequest(AphrontRequest $request) {
14
$host = $request->getHost();
15
16
$uri = PhabricatorEnv::getEnvConfig('security.alternate-file-domain');
17
if (!strlen($uri)) {
18
return null;
19
}
20
21
if ($this->isHostMatch($host, array($uri))) {
22
return new PhabricatorResourceSite();
23
}
24
25
return null;
26
}
27
28
public function getRoutingMaps() {
29
$applications = PhabricatorApplication::getAllInstalledApplications();
30
31
$maps = array();
32
foreach ($applications as $application) {
33
$maps[] = $this->newRoutingMap()
34
->setApplication($application)
35
->setRoutes($application->getResourceRoutes());
36
}
37
38
return $maps;
39
}
40
41
}
42
43