Path: blob/master/src/applications/celerity/resources/CelerityPhysicalResources.php
12256 views
<?php12/**3* Defines the location of physical static resources which exist at build time4* and are precomputed into a resource map.5*/6abstract class CelerityPhysicalResources extends CelerityResources {78private $map;910abstract public function getPathToMap();11abstract public function findBinaryResources();12abstract public function findTextResources();1314public function loadMap() {15if ($this->map === null) {16$this->map = include $this->getPathToMap();17}18return $this->map;19}2021public static function getAll() {22static $resources_map;2324if ($resources_map === null) {25$resources_list = id(new PhutilClassMapQuery())26->setAncestorClass(__CLASS__)27->setUniqueMethod('getName')28->execute();2930foreach ($resources_list as $resources) {31$name = $resources->getName();3233if (!preg_match('/^[a-z0-9]+/', $name)) {34throw new Exception(35pht(36'Resources name "%s" is not valid; it must contain only '.37'lowercase latin letters and digits.',38$name));39}40}4142$resources_map = $resources_list;43}4445return $resources_map;46}4748}495051