| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 32 | public function install(string $moduleID, string $version = ''): void |
||
| 33 | { |
||
| 34 | $modulesPath = Config::get(self::CONFIG_MODULES_PATH_NAME); |
||
| 35 | $destinationPath = $modulesPath . '/' . ucfirst($moduleID); |
||
| 36 | |||
| 37 | if (!is_writable($modulesPath)) { |
||
| 38 | throw new GameapException('No write permissions to modules directory'); |
||
| 39 | } |
||
| 40 | |||
| 41 | $downloadedFilePath = $this->marketplaceService->downloadModule($moduleID, $version); |
||
| 42 | $this->archiver->extractTarGzip($downloadedFilePath, $destinationPath, 1); |
||
| 43 | } |
||
| 45 |