Differential D19941 Diff 47635 src/applications/celerity/controller/CelerityPhabricatorResourceController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/celerity/controller/CelerityPhabricatorResourceController.php
| Show All 33 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| return $this->serveResource( | return $this->serveResource( | ||||
| array( | array( | ||||
| 'path' => $this->path, | 'path' => $this->path, | ||||
| 'hash' => $this->hash, | 'hash' => $this->hash, | ||||
| )); | )); | ||||
| } | } | ||||
| protected function buildResourceTransformer() { | protected function buildResourceTransformer() { | ||||
| $minify_on = PhabricatorEnv::getEnvConfig('celerity.minify'); | |||||
| $developer_on = PhabricatorEnv::getEnvConfig('phabricator.developer-mode'); | $developer_on = PhabricatorEnv::getEnvConfig('phabricator.developer-mode'); | ||||
| $should_minify = !$developer_on; | |||||
| $should_minify = ($minify_on && !$developer_on); | |||||
| return id(new CelerityResourceTransformer()) | return id(new CelerityResourceTransformer()) | ||||
| ->setMinify($should_minify) | ->setMinify($should_minify) | ||||
| ->setPostprocessorKey($this->postprocessorKey) | ->setPostprocessorKey($this->postprocessorKey) | ||||
| ->setCelerityMap($this->getCelerityResourceMap()); | ->setCelerityMap($this->getCelerityResourceMap()); | ||||
| } | } | ||||
| protected function getCacheKey($path) { | protected function getCacheKey($path) { | ||||
| return parent::getCacheKey($path.';'.$this->postprocessorKey); | return parent::getCacheKey($path.';'.$this->postprocessorKey); | ||||
| } | } | ||||
| } | } | ||||