Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894553
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/aphront/site/PhabricatorResourceSite.php b/src/aphront/site/PhabricatorResourceSite.php
new file mode 100644
index 0000000000..88f7777607
--- /dev/null
+++ b/src/aphront/site/PhabricatorResourceSite.php
@@ -0,0 +1,41 @@
+<?php
+
+final class PhabricatorResourceSite extends PhabricatorSite {
+
+ public function getDescription() {
+ return pht('Serves static resources like images, CSS and JS.');
+ }
+
+ public function getPriority() {
+ return 2000;
+ }
+
+ public function newSiteForRequest(AphrontRequest $request) {
+ $host = $request->getHost();
+
+ $uri = PhabricatorEnv::getEnvConfig('security.alternate-file-domain');
+ if (!strlen($uri)) {
+ return null;
+ }
+
+ if ($this->isHostMatch($host, array($uri))) {
+ return new PhabricatorResourceSite();
+ }
+
+ return null;
+ }
+
+ public function getRoutingMaps() {
+ $applications = PhabricatorApplication::getAllInstalledApplications();
+
+ $maps = array();
+ foreach ($applications as $application) {
+ $maps[] = $this->newRoutingMap()
+ ->setApplication($application)
+ ->setRoutes($application->getResourceRoutes());
+ }
+
+ return $maps;
+ }
+
+}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Jan 19, 20:03 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1128264
Default Alt Text
(1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment