@@ -31,54 +31,54 @@ |
||
| 31 | 31 | |
| 32 | 32 | class Install extends Command { |
| 33 | 33 | |
| 34 | - protected function configure() { |
|
| 35 | - $this |
|
| 36 | - ->setName('app:install') |
|
| 37 | - ->setDescription('install an app') |
|
| 38 | - ->addArgument( |
|
| 39 | - 'app-id', |
|
| 40 | - InputArgument::REQUIRED, |
|
| 41 | - 'install the specified app' |
|
| 42 | - ) |
|
| 43 | - ->addOption( |
|
| 44 | - 'keep-disabled', |
|
| 45 | - null, |
|
| 46 | - InputOption::VALUE_NONE, |
|
| 47 | - 'don\'t enable the app afterwards' |
|
| 48 | - ) |
|
| 49 | - ; |
|
| 50 | - } |
|
| 34 | + protected function configure() { |
|
| 35 | + $this |
|
| 36 | + ->setName('app:install') |
|
| 37 | + ->setDescription('install an app') |
|
| 38 | + ->addArgument( |
|
| 39 | + 'app-id', |
|
| 40 | + InputArgument::REQUIRED, |
|
| 41 | + 'install the specified app' |
|
| 42 | + ) |
|
| 43 | + ->addOption( |
|
| 44 | + 'keep-disabled', |
|
| 45 | + null, |
|
| 46 | + InputOption::VALUE_NONE, |
|
| 47 | + 'don\'t enable the app afterwards' |
|
| 48 | + ) |
|
| 49 | + ; |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 53 | - $appId = $input->getArgument('app-id'); |
|
| 52 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 53 | + $appId = $input->getArgument('app-id'); |
|
| 54 | 54 | |
| 55 | - if (\OC_App::getAppPath($appId)) { |
|
| 56 | - $output->writeln($appId . ' already installed'); |
|
| 57 | - return 1; |
|
| 58 | - } |
|
| 55 | + if (\OC_App::getAppPath($appId)) { |
|
| 56 | + $output->writeln($appId . ' already installed'); |
|
| 57 | + return 1; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - try { |
|
| 61 | - $installer = \OC::$server->query(Installer::class); |
|
| 62 | - $installer->downloadApp($appId); |
|
| 63 | - $result = $installer->installApp($appId); |
|
| 64 | - } catch(\Exception $e) { |
|
| 65 | - $output->writeln('Error: ' . $e->getMessage()); |
|
| 66 | - return 1; |
|
| 67 | - } |
|
| 60 | + try { |
|
| 61 | + $installer = \OC::$server->query(Installer::class); |
|
| 62 | + $installer->downloadApp($appId); |
|
| 63 | + $result = $installer->installApp($appId); |
|
| 64 | + } catch(\Exception $e) { |
|
| 65 | + $output->writeln('Error: ' . $e->getMessage()); |
|
| 66 | + return 1; |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - if($result === false) { |
|
| 70 | - $output->writeln($appId . ' couldn\'t be installed'); |
|
| 71 | - return 1; |
|
| 72 | - } |
|
| 69 | + if($result === false) { |
|
| 70 | + $output->writeln($appId . ' couldn\'t be installed'); |
|
| 71 | + return 1; |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - $output->writeln($appId . ' installed'); |
|
| 74 | + $output->writeln($appId . ' installed'); |
|
| 75 | 75 | |
| 76 | - if (!$input->getOption('keep-disabled')) { |
|
| 77 | - $appClass = new \OC_App(); |
|
| 78 | - $appClass->enable($appId); |
|
| 79 | - $output->writeln($appId . ' enabled'); |
|
| 80 | - } |
|
| 76 | + if (!$input->getOption('keep-disabled')) { |
|
| 77 | + $appClass = new \OC_App(); |
|
| 78 | + $appClass->enable($appId); |
|
| 79 | + $output->writeln($appId . ' enabled'); |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - return 0; |
|
| 83 | - } |
|
| 82 | + return 0; |
|
| 83 | + } |
|
| 84 | 84 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $appId = $input->getArgument('app-id'); |
| 54 | 54 | |
| 55 | 55 | if (\OC_App::getAppPath($appId)) { |
| 56 | - $output->writeln($appId . ' already installed'); |
|
| 56 | + $output->writeln($appId.' already installed'); |
|
| 57 | 57 | return 1; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -61,22 +61,22 @@ discard block |
||
| 61 | 61 | $installer = \OC::$server->query(Installer::class); |
| 62 | 62 | $installer->downloadApp($appId); |
| 63 | 63 | $result = $installer->installApp($appId); |
| 64 | - } catch(\Exception $e) { |
|
| 65 | - $output->writeln('Error: ' . $e->getMessage()); |
|
| 64 | + } catch (\Exception $e) { |
|
| 65 | + $output->writeln('Error: '.$e->getMessage()); |
|
| 66 | 66 | return 1; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - if($result === false) { |
|
| 70 | - $output->writeln($appId . ' couldn\'t be installed'); |
|
| 69 | + if ($result === false) { |
|
| 70 | + $output->writeln($appId.' couldn\'t be installed'); |
|
| 71 | 71 | return 1; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - $output->writeln($appId . ' installed'); |
|
| 74 | + $output->writeln($appId.' installed'); |
|
| 75 | 75 | |
| 76 | 76 | if (!$input->getOption('keep-disabled')) { |
| 77 | 77 | $appClass = new \OC_App(); |
| 78 | 78 | $appClass->enable($appId); |
| 79 | - $output->writeln($appId . ' enabled'); |
|
| 79 | + $output->writeln($appId.' enabled'); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | return 0; |