summaryrefslogtreecommitdiffstats
path: root/core/command/app
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2016-01-14 16:09:34 +0100
committerJoas Schilling <nickvergessen@owncloud.com>2016-01-19 14:29:01 +0100
commit78a02d1b2f60fb04827673d1b5d6ccde2880157f (patch)
treee6ba55066f7f298d355f966c28c30b04d5dd7823 /core/command/app
parentd2285113a891fa2e34f4615c4b30490098577649 (diff)
downloadnextcloud-server-78a02d1b2f60fb04827673d1b5d6ccde2880157f.tar.gz
nextcloud-server-78a02d1b2f60fb04827673d1b5d6ccde2880157f.zip
Make it possible to disable apps via the console, which are not enabled for the current user
Diffstat (limited to 'core/command/app')
-rw-r--r--core/command/app/disable.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/core/command/app/disable.php b/core/command/app/disable.php
index b5e776d7e03..b3157faf32e 100644
--- a/core/command/app/disable.php
+++ b/core/command/app/disable.php
@@ -23,12 +23,25 @@
namespace OC\Core\Command\App;
+use OCP\App\IAppManager;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class Disable extends Command {
+
+ /** @var IAppManager */
+ protected $manager;
+
+ /**
+ * @param IAppManager $manager
+ */
+ public function __construct(IAppManager $manager) {
+ parent::__construct();
+ $this->manager = $manager;
+ }
+
protected function configure() {
$this
->setName('app:disable')
@@ -42,9 +55,9 @@ class Disable extends Command {
protected function execute(InputInterface $input, OutputInterface $output) {
$appId = $input->getArgument('app-id');
- if (\OC_App::isEnabled($appId)) {
+ if ($this->manager->isInstalled($appId)) {
try {
- \OC_App::disable($appId);
+ $this->manager->disableApp($appId);
$output->writeln($appId . ' disabled');
} catch(\Exception $e) {
$output->writeln($e->getMessage());