Page MenuHomePhorge

No OneTemporary

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

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)

Event Timeline