@@ -35,63 +35,63 @@ |
||
35 | 35 | use Symfony\Component\Console\Output\OutputInterface; |
36 | 36 | |
37 | 37 | class Install extends Command { |
38 | - protected function configure() { |
|
39 | - $this |
|
40 | - ->setName('app:install') |
|
41 | - ->setDescription('install an app') |
|
42 | - ->addArgument( |
|
43 | - 'app-id', |
|
44 | - InputArgument::REQUIRED, |
|
45 | - 'install the specified app' |
|
46 | - ) |
|
47 | - ->addOption( |
|
48 | - 'keep-disabled', |
|
49 | - null, |
|
50 | - InputOption::VALUE_NONE, |
|
51 | - 'don\'t enable the app afterwards' |
|
52 | - ) |
|
53 | - ->addOption( |
|
54 | - 'force', |
|
55 | - 'f', |
|
56 | - InputOption::VALUE_NONE, |
|
57 | - 'install the app regardless of the Nextcloud version requirement' |
|
58 | - ) |
|
59 | - ; |
|
60 | - } |
|
38 | + protected function configure() { |
|
39 | + $this |
|
40 | + ->setName('app:install') |
|
41 | + ->setDescription('install an app') |
|
42 | + ->addArgument( |
|
43 | + 'app-id', |
|
44 | + InputArgument::REQUIRED, |
|
45 | + 'install the specified app' |
|
46 | + ) |
|
47 | + ->addOption( |
|
48 | + 'keep-disabled', |
|
49 | + null, |
|
50 | + InputOption::VALUE_NONE, |
|
51 | + 'don\'t enable the app afterwards' |
|
52 | + ) |
|
53 | + ->addOption( |
|
54 | + 'force', |
|
55 | + 'f', |
|
56 | + InputOption::VALUE_NONE, |
|
57 | + 'install the app regardless of the Nextcloud version requirement' |
|
58 | + ) |
|
59 | + ; |
|
60 | + } |
|
61 | 61 | |
62 | - protected function execute(InputInterface $input, OutputInterface $output): int { |
|
63 | - $appId = $input->getArgument('app-id'); |
|
64 | - $forceEnable = (bool) $input->getOption('force'); |
|
62 | + protected function execute(InputInterface $input, OutputInterface $output): int { |
|
63 | + $appId = $input->getArgument('app-id'); |
|
64 | + $forceEnable = (bool) $input->getOption('force'); |
|
65 | 65 | |
66 | - if (\OC_App::getAppPath($appId)) { |
|
67 | - $output->writeln($appId . ' already installed'); |
|
68 | - return 1; |
|
69 | - } |
|
66 | + if (\OC_App::getAppPath($appId)) { |
|
67 | + $output->writeln($appId . ' already installed'); |
|
68 | + return 1; |
|
69 | + } |
|
70 | 70 | |
71 | - try { |
|
72 | - /** @var Installer $installer */ |
|
73 | - $installer = \OC::$server->query(Installer::class); |
|
74 | - $installer->downloadApp($appId); |
|
75 | - $result = $installer->installApp($appId, $forceEnable); |
|
76 | - } catch (\Exception $e) { |
|
77 | - $output->writeln('Error: ' . $e->getMessage()); |
|
78 | - return 1; |
|
79 | - } |
|
71 | + try { |
|
72 | + /** @var Installer $installer */ |
|
73 | + $installer = \OC::$server->query(Installer::class); |
|
74 | + $installer->downloadApp($appId); |
|
75 | + $result = $installer->installApp($appId, $forceEnable); |
|
76 | + } catch (\Exception $e) { |
|
77 | + $output->writeln('Error: ' . $e->getMessage()); |
|
78 | + return 1; |
|
79 | + } |
|
80 | 80 | |
81 | - if ($result === false) { |
|
82 | - $output->writeln($appId . ' couldn\'t be installed'); |
|
83 | - return 1; |
|
84 | - } |
|
81 | + if ($result === false) { |
|
82 | + $output->writeln($appId . ' couldn\'t be installed'); |
|
83 | + return 1; |
|
84 | + } |
|
85 | 85 | |
86 | - $appVersion = \OC_App::getAppVersion($appId); |
|
87 | - $output->writeln($appId . ' ' . $appVersion . ' installed'); |
|
86 | + $appVersion = \OC_App::getAppVersion($appId); |
|
87 | + $output->writeln($appId . ' ' . $appVersion . ' installed'); |
|
88 | 88 | |
89 | - if (!$input->getOption('keep-disabled')) { |
|
90 | - $appClass = new \OC_App(); |
|
91 | - $appClass->enable($appId); |
|
92 | - $output->writeln($appId . ' enabled'); |
|
93 | - } |
|
89 | + if (!$input->getOption('keep-disabled')) { |
|
90 | + $appClass = new \OC_App(); |
|
91 | + $appClass->enable($appId); |
|
92 | + $output->writeln($appId . ' enabled'); |
|
93 | + } |
|
94 | 94 | |
95 | - return 0; |
|
96 | - } |
|
95 | + return 0; |
|
96 | + } |
|
97 | 97 | } |