Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/storage/PhabricatorFile.php
| Show First 20 Lines • Show All 876 Lines • ▼ Show 20 Lines | public static function buildEngine($engine_identifier) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| "Storage engine '%s' could not be located!", | "Storage engine '%s' could not be located!", | ||||
| $engine_identifier)); | $engine_identifier)); | ||||
| } | } | ||||
| public static function buildAllEngines() { | public static function buildAllEngines() { | ||||
| $engines = id(new PhutilSymbolLoader()) | return id(new PhutilClassMapQuery()) | ||||
| ->setType('class') | |||||
| ->setConcreteOnly(true) | |||||
| ->setAncestorClass('PhabricatorFileStorageEngine') | ->setAncestorClass('PhabricatorFileStorageEngine') | ||||
| ->selectAndLoadSymbols(); | ->execute(); | ||||
| $results = array(); | |||||
| foreach ($engines as $engine_class) { | |||||
| $results[] = newv($engine_class['name'], array()); | |||||
| } | |||||
| return $results; | |||||
| } | } | ||||
| public function getViewableMimeType() { | public function getViewableMimeType() { | ||||
| $mime_map = PhabricatorEnv::getEnvConfig('files.viewable-mime-types'); | $mime_map = PhabricatorEnv::getEnvConfig('files.viewable-mime-types'); | ||||
| $mime_type = $this->getMimeType(); | $mime_type = $this->getMimeType(); | ||||
| $mime_parts = explode(';', $mime_type); | $mime_parts = explode(';', $mime_type); | ||||
| $mime_type = trim(reset($mime_parts)); | $mime_type = trim(reset($mime_parts)); | ||||
| ▲ Show 20 Lines • Show All 486 Lines • Show Last 20 Lines | |||||