From 323eb2e8baa556ad52ba1202e992a982433a1f1b Mon Sep 17 00:00:00 2001 From: sualko Date: Wed, 13 Sep 2017 12:30:03 +0200 Subject: [PATCH 1/2] add enable flag to occ app:install (fix #5834) Signed-off-by: Klaus Herberth --- core/Command/App/Install.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/Command/App/Install.php b/core/Command/App/Install.php index 8f530975be9..95c8d2ec755 100644 --- a/core/Command/App/Install.php +++ b/core/Command/App/Install.php @@ -25,6 +25,7 @@ namespace OC\Core\Command\App; use OC\Installer; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -39,6 +40,12 @@ class Install extends Command { InputArgument::REQUIRED, 'install the specified app' ) + ->addOption( + 'enable', + null, + InputOption::VALUE_NONE, + 'enable the app afterwards' + ) ; } @@ -66,6 +73,12 @@ class Install extends Command { $output->writeln($appId . ' installed'); + if ($input->getOption('enable')) { + $appClass = new \OC_App(); + $appClass->enable($appId); + $output->writeln($appId . ' enabled'); + } + return 0; } } From 84f6477ce551a9fe69150acaf0158651c644cf58 Mon Sep 17 00:00:00 2001 From: sualko Date: Tue, 20 Feb 2018 10:54:41 +0100 Subject: [PATCH 2/2] enable app by default after occ app:install Signed-off-by: Klaus Herberth --- core/Command/App/Install.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/Command/App/Install.php b/core/Command/App/Install.php index 95c8d2ec755..4432a1f40ac 100644 --- a/core/Command/App/Install.php +++ b/core/Command/App/Install.php @@ -41,10 +41,10 @@ class Install extends Command { 'install the specified app' ) ->addOption( - 'enable', + 'keep-disabled', null, InputOption::VALUE_NONE, - 'enable the app afterwards' + 'don\'t enable the app afterwards' ) ; } @@ -73,7 +73,7 @@ class Install extends Command { $output->writeln($appId . ' installed'); - if ($input->getOption('enable')) { + if (!$input->getOption('keep-disabled')) { $appClass = new \OC_App(); $appClass->enable($appId); $output->writeln($appId . ' enabled');