forked from phacility/phabricator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhabricatorCelerityApplication.php
45 lines (36 loc) · 1.18 KB
/
PhabricatorCelerityApplication.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
final class PhabricatorCelerityApplication extends PhabricatorApplication {
public function getName() {
return pht('Celerity');
}
public function canUninstall() {
return false;
}
public function isUnlisted() {
return true;
}
public function getRoutes() {
// We serve resources from both the platform site and the resource site.
// This is safe because the user doesn't have any direct control over
// resources.
// The advantage of serving resources from the resource site (if possible)
// is that we can use a CDN there if one is configured, but there is no
// particular security concern.
return $this->getResourceRoutes();
}
public function getResourceRoutes() {
$extensions = CelerityResourceController::getSupportedResourceTypes();
$extensions = array_keys($extensions);
$extensions = implode('|', $extensions);
return array(
'/res/' => array(
'(?:(?P<mtime>[0-9]+)T/)?'.
'(?:(?P<postprocessor>[^/]+)X/)?'.
'(?P<library>[^/]+)/'.
'(?P<hash>[a-f0-9]{8})/'.
'(?P<path>.+\.(?:'.$extensions.'))'
=> 'CelerityPhabricatorResourceController',
),
);
}
}