| @@ 205-219 (lines=15) @@ | ||
| 202 | * |
|
| 203 | * @return void |
|
| 204 | */ |
|
| 205 | public function installCommand($key) { |
|
| 206 | try { |
|
| 207 | $this->emitPackagesMayHaveChangedSignal(); |
|
| 208 | $this->extensionApiService->installExtension($key); |
|
| 209 | } catch (Exception $e) { |
|
| 210 | $message = $e->getMessage(); |
|
| 211 | $this->outputLine($message); |
|
| 212 | $this->logger->error($message); |
|
| 213 | $this->quit(1); |
|
| 214 | } |
|
| 215 | ||
| 216 | $message = sprintf('Extension "%s" is now installed!', $key); |
|
| 217 | $this->outputLine($message); |
|
| 218 | $this->logger->info($message); |
|
| 219 | } |
|
| 220 | ||
| 221 | /** |
|
| 222 | * UnInstall(deactivate) an extension. |
|
| @@ 228-241 (lines=14) @@ | ||
| 225 | * |
|
| 226 | * @return void |
|
| 227 | */ |
|
| 228 | public function uninstallCommand($key) { |
|
| 229 | try { |
|
| 230 | $this->extensionApiService->uninstallExtension($key); |
|
| 231 | } catch (Exception $e) { |
|
| 232 | $message = $e->getMessage(); |
|
| 233 | $this->outputLine($message); |
|
| 234 | $this->logger->error($message); |
|
| 235 | $this->quit(1); |
|
| 236 | } |
|
| 237 | ||
| 238 | $message = sprintf('Extension "%s" is now uninstalled!', $key); |
|
| 239 | $this->outputLine($message); |
|
| 240 | $this->logger->info($message); |
|
| 241 | } |
|
| 242 | ||
| 243 | /** |
|
| 244 | * Configure an extension. |
|
| @@ 361-372 (lines=12) @@ | ||
| 358 | * |
|
| 359 | * @return void |
|
| 360 | */ |
|
| 361 | public function importCommand($file, $location = 'Local', $overwrite = FALSE) { |
|
| 362 | try { |
|
| 363 | $data = $this->extensionApiService->importExtension($file, $location, $overwrite); |
|
| 364 | $message = sprintf('Extension "%s" has been imported!', $data['extKey']); |
|
| 365 | $this->outputLine($message); |
|
| 366 | $this->logger->info($message); |
|
| 367 | } catch (Exception $e) { |
|
| 368 | $this->outputLine($e->getMessage()); |
|
| 369 | $this->logger->error($e->getMessage()); |
|
| 370 | $this->quit(1); |
|
| 371 | } |
|
| 372 | } |
|
| 373 | ||
| 374 | /** |
|
| 375 | * Emits packages may have changed signal |
|