Differential D15775 Diff 38019 src/applications/celerity/controller/CelerityPhabricatorResourceController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/celerity/controller/CelerityPhabricatorResourceController.php
Show All 25 Lines | public function handleRequest(AphrontRequest $request) { | ||||
// Check that the resource library exists before trying to serve resources | // Check that the resource library exists before trying to serve resources | ||||
// from it. | // from it. | ||||
try { | try { | ||||
$this->getCelerityResourceMap(); | $this->getCelerityResourceMap(); | ||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
return new Aphront400Response(); | return new Aphront400Response(); | ||||
} | } | ||||
return $this->serveResource($this->path); | return $this->serveResource( | ||||
array( | |||||
'path' => $this->path, | |||||
'hash' => $this->hash, | |||||
)); | |||||
} | } | ||||
protected function buildResourceTransformer() { | protected function buildResourceTransformer() { | ||||
$minify_on = PhabricatorEnv::getEnvConfig('celerity.minify'); | $minify_on = PhabricatorEnv::getEnvConfig('celerity.minify'); | ||||
$developer_on = PhabricatorEnv::getEnvConfig('phabricator.developer-mode'); | $developer_on = PhabricatorEnv::getEnvConfig('phabricator.developer-mode'); | ||||
$should_minify = ($minify_on && !$developer_on); | $should_minify = ($minify_on && !$developer_on); | ||||
Show All 11 Lines |