| @@ 66-76 (lines=11) @@ | ||
| 63 | * |
|
| 64 | * @throws \Exception |
|
| 65 | */ |
|
| 66 | private function config() |
|
| 67 | { |
|
| 68 | $configPath = __DIR__ . '/../../config.json'; |
|
| 69 | if (realpath($configPath) !== false) { |
|
| 70 | $json = file_get_contents($configPath); |
|
| 71 | $this->config = json_decode($json); |
|
| 72 | } else { |
|
| 73 | initFramework("/../../storage.json"); |
|
| 74 | $this->config(); |
|
| 75 | } |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * Initialize the storage |
|
| @@ 34-44 (lines=11) @@ | ||
| 31 | * |
|
| 32 | * @throws \Exception |
|
| 33 | */ |
|
| 34 | private function config() |
|
| 35 | { |
|
| 36 | $storagePath = __DIR__ . $this->storagePath; |
|
| 37 | if (realpath($storagePath) !== false) { |
|
| 38 | $jsonString = file_get_contents($storagePath); |
|
| 39 | $this->repository = json_decode($jsonString); |
|
| 40 | } else { |
|
| 41 | // Here is some logic for the initialisation of a new clone of the framework |
|
| 42 | initFramework($storagePath); |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||
| 46 | ||
| 47 | ||