Changeset View
Changeset View
Standalone View
Standalone View
src/config/source/ArcanistFilesystemConfigurationSource.php
| Show All 10 Lines | public function __construct($path) { | ||||
| $values = array(); | $values = array(); | ||||
| if (Filesystem::pathExists($path)) { | if (Filesystem::pathExists($path)) { | ||||
| $contents = Filesystem::readFile($path); | $contents = Filesystem::readFile($path); | ||||
| if (strlen(trim($contents))) { | if (strlen(trim($contents))) { | ||||
| $values = phutil_json_decode($contents); | $values = phutil_json_decode($contents); | ||||
| } | } | ||||
| } | } | ||||
| $values = $this->didReadFilesystemValues($values); | |||||
| parent::__construct($values); | parent::__construct($values); | ||||
| } | } | ||||
| public function getPath() { | public function getPath() { | ||||
| return $this->path; | return $this->path; | ||||
| } | } | ||||
| public function getSourceDisplayName() { | public function getSourceDisplayName() { | ||||
| return pht('%s (%s)', $this->getFileKindDisplayName(), $this->getPath()); | return pht('%s (%s)', $this->getFileKindDisplayName(), $this->getPath()); | ||||
| } | } | ||||
| abstract public function getFileKindDisplayName(); | abstract public function getFileKindDisplayName(); | ||||
| protected function didReadFilesystemValues(array $values) { | |||||
| return $values; | |||||
| } | |||||
| } | } | ||||
| No newline at end of file | No newline at end of file | ||||