Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/celerity/CelerityResourceMap.php
| Show All 14 Lines | final class CelerityResourceMap { | ||||
| private $packageMap; | private $packageMap; | ||||
| private $reverseMap; | private $reverseMap; | ||||
| public static function getInstance() { | public static function getInstance() { | ||||
| if (empty(self::$instance)) { | if (empty(self::$instance)) { | ||||
| self::$instance = new CelerityResourceMap(); | self::$instance = new CelerityResourceMap(); | ||||
| $root = phutil_get_library_root('phabricator'); | $root = phutil_get_library_root('phabricator'); | ||||
| $path = PhabricatorEnv::getEnvConfig('celerity.resource-path'); | $path = '__celerity_resource_map__.php'; | ||||
| $ok = include_once $root.'/'.$path; | $ok = include_once $root.'/'.$path; | ||||
| if (!$ok) { | if (!$ok) { | ||||
| throw new Exception( | throw new Exception( | ||||
| "Failed to load Celerity resource map! Check the ". | "Failed to load Celerity resource map!"); | ||||
| "'celerity.resource-path' setting in your configuration."); | |||||
| } | } | ||||
| } | } | ||||
| return self::$instance; | return self::$instance; | ||||
| } | } | ||||
| public function setResourceMap($resource_map) { | public function setResourceMap($resource_map) { | ||||
| $this->resourceMap = $resource_map; | $this->resourceMap = $resource_map; | ||||
| return $this; | return $this; | ||||
| ▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines | |||||