Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/celerity/application/PhabricatorCelerityApplication.php
12256 views
1
<?php
2
3
final class PhabricatorCelerityApplication extends PhabricatorApplication {
4
5
public function getName() {
6
return pht('Celerity');
7
}
8
9
public function canUninstall() {
10
return false;
11
}
12
13
public function isUnlisted() {
14
return true;
15
}
16
17
public function getRoutes() {
18
// We serve resources from both the platform site and the resource site.
19
// This is safe because the user doesn't have any direct control over
20
// resources.
21
22
// The advantage of serving resources from the resource site (if possible)
23
// is that we can use a CDN there if one is configured, but there is no
24
// particular security concern.
25
return $this->getResourceRoutes();
26
}
27
28
public function getResourceRoutes() {
29
$extensions = CelerityResourceController::getSupportedResourceTypes();
30
$extensions = array_keys($extensions);
31
$extensions = implode('|', $extensions);
32
33
return array(
34
'/res/' => array(
35
'(?:(?P<mtime>[0-9]+)T/)?'.
36
'(?:(?P<postprocessor>[^/]+)X/)?'.
37
'(?P<library>[^/]+)/'.
38
'(?P<hash>[a-f0-9]{8})/'.
39
'(?P<path>.+\.(?:'.$extensions.'))'
40
=> 'CelerityPhabricatorResourceController',
41
),
42
);
43
}
44
45
}
46
47