Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/celerity/CelerityResourceController.php
| Show All 33 Lines | if (AphrontRequest::getHTTPHeader('If-Modified-Since') && | ||||
| !PhabricatorEnv::getEnvConfig('phabricator.developer-mode')) { | !PhabricatorEnv::getEnvConfig('phabricator.developer-mode')) { | ||||
| // Return a "304 Not Modified". We don't care about the value of this | // Return a "304 Not Modified". We don't care about the value of this | ||||
| // field since we never change what resource is served by a given URI. | // field since we never change what resource is served by a given URI. | ||||
| return $this->makeResponseCacheable(new Aphront304Response()); | return $this->makeResponseCacheable(new Aphront304Response()); | ||||
| } | } | ||||
| $map = CelerityResourceMap::getInstance(); | $map = CelerityResourceMap::getInstance(); | ||||
| if ($package_hash) { | if ($map->isPackageResource($path)) { | ||||
| $resource_names = $map->getResourceNamesForPackageHash($package_hash); | $resource_names = $map->getResourceNamesForPackageName($path); | ||||
| if (!$resource_names) { | if (!$resource_names) { | ||||
| return new Aphront404Response(); | return new Aphront404Response(); | ||||
| } | } | ||||
| try { | try { | ||||
| $data = array(); | $data = array(); | ||||
| foreach ($resource_names as $resource_name) { | foreach ($resource_names as $resource_name) { | ||||
| $data[] = $map->getResourceDataForName($resource_name); | $data[] = $map->getResourceDataForName($resource_name); | ||||
| ▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines | |||||