From b17fa7dfa588fc191f4ed268b88dcaec40294acb Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 8 Dec 2016 14:24:02 -0800 Subject: [ticket/14895] Use SymfonyStyle in all CLI PHPBB3-14895 --- phpBB/phpbb/console/command/extension/enable.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/console/command/extension/enable.php') diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index 59ff11e9b7..14077d688b 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -15,6 +15,7 @@ namespace phpbb\console\command\extension; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; class enable extends command { @@ -33,6 +34,8 @@ class enable extends command protected function execute(InputInterface $input, OutputInterface $output) { + $io = new SymfonyStyle($input, $output); + $name = $input->getArgument('extension-name'); $this->manager->enable($name); $this->manager->load_extensions(); @@ -40,12 +43,12 @@ class enable extends command if ($this->manager->is_enabled($name)) { $this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_ENABLE', time(), array($name)); - $output->writeln('' . $this->user->lang('CLI_EXTENSION_ENABLE_SUCCESS', $name) . ''); + $io->success($this->user->lang('CLI_EXTENSION_ENABLE_SUCCESS', $name)); return 0; } else { - $output->writeln('' . $this->user->lang('CLI_EXTENSION_ENABLE_FAILURE', $name) . ''); + $io->error($this->user->lang('CLI_EXTENSION_ENABLE_FAILURE', $name)); return 1; } } -- cgit v1.2.1 From 891aab05935e9ebc237a83cef0b248998cb5fccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sat, 11 Mar 2017 20:34:40 +0100 Subject: [ticket/15123] add check before enable or disable extension PHPBB3-15123 --- phpBB/phpbb/console/command/extension/enable.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'phpBB/phpbb/console/command/extension/enable.php') diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index 14077d688b..2de7498c71 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -37,6 +37,13 @@ class enable extends command $io = new SymfonyStyle($input, $output); $name = $input->getArgument('extension-name'); + + if ($this->manager->is_enabled($name)) + { + $io->error($this->user->lang('CLI_EXTENSION_ALREADY_ENABLED', $name)); + return 1; + } + $this->manager->enable($name); $this->manager->load_extensions(); -- cgit v1.2.1 From 68c167fe7a5f0c86d97c9c3dda30f66d9df5b032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sat, 11 Mar 2017 20:39:16 +0100 Subject: [ticket/15123] removed blank spaces PHPBB3-15123 --- phpBB/phpbb/console/command/extension/enable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/extension/enable.php') diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index 2de7498c71..e6b5f66c7f 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -43,7 +43,7 @@ class enable extends command $io->error($this->user->lang('CLI_EXTENSION_ALREADY_ENABLED', $name)); return 1; } - + $this->manager->enable($name); $this->manager->load_extensions(); -- cgit v1.2.1 From 8994295f2b7d5b2beece7bbd8f7a2861fa15625d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sat, 11 Mar 2017 23:03:31 +0100 Subject: [ticket/15123] modified language string PHPBB3-15123 --- phpBB/phpbb/console/command/extension/enable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/extension/enable.php') diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index e6b5f66c7f..c7c336cdc9 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -40,7 +40,7 @@ class enable extends command if ($this->manager->is_enabled($name)) { - $io->error($this->user->lang('CLI_EXTENSION_ALREADY_ENABLED', $name)); + $io->error($this->user->lang('CLI_EXTENSION_ENABLE_ENABLED', $name)); return 1; } -- cgit v1.2.1 From 9b3609d6f60af328e6681146014453da0af4ee01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sun, 12 Mar 2017 22:44:18 +0100 Subject: [ticket/15123] modified language strings PHPBB3-15123 --- phpBB/phpbb/console/command/extension/enable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/extension/enable.php') diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index c7c336cdc9..079e4ce1f6 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -40,7 +40,7 @@ class enable extends command if ($this->manager->is_enabled($name)) { - $io->error($this->user->lang('CLI_EXTENSION_ENABLE_ENABLED', $name)); + $io->error($this->user->lang('CLI_EXTENSION_ENABLED', $name)); return 1; } -- cgit v1.2.1 From 45f0adcd0a4e6c7e43183fe641fa03ef2d90d45b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sun, 12 Mar 2017 22:45:33 +0100 Subject: [ticket/15123] modified return error codes PHPBB3-15123 --- phpBB/phpbb/console/command/extension/enable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/extension/enable.php') diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index 079e4ce1f6..a8312d5c15 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -41,7 +41,7 @@ class enable extends command if ($this->manager->is_enabled($name)) { $io->error($this->user->lang('CLI_EXTENSION_ENABLED', $name)); - return 1; + return 2; } $this->manager->enable($name); -- cgit v1.2.1 From aa23af38d4d3a13918e859005277955debd76acd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Thu, 7 Sep 2017 12:53:44 +0200 Subject: [ticket/15349] Check if extension is enableable before enable PHPBB3-15346 --- phpBB/phpbb/console/command/extension/enable.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'phpBB/phpbb/console/command/extension/enable.php') diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index a8312d5c15..b35fb9c4c6 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -37,6 +37,13 @@ class enable extends command $io = new SymfonyStyle($input, $output); $name = $input->getArgument('extension-name'); + $extension = $this->manager->get_extension($name); + + if (!$extension->is_enableable()) + { + $io->error($this->user->lang('CLI_EXTENSION_NOT_ENABLEABLE', $name)); + return 1; + } if ($this->manager->is_enabled($name)) { -- cgit v1.2.1 From bf289de26f137bfe50608b6f9c549b306ede5b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Thu, 7 Sep 2017 12:54:13 +0200 Subject: [ticket/15349] Return 1 instead of 2 in case of error PHPBB3-15346 --- phpBB/phpbb/console/command/extension/enable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/console/command/extension/enable.php') diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index b35fb9c4c6..f92de0069c 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -48,7 +48,7 @@ class enable extends command if ($this->manager->is_enabled($name)) { $io->error($this->user->lang('CLI_EXTENSION_ENABLED', $name)); - return 2; + return 1; } $this->manager->enable($name); -- cgit v1.2.1 From 03b3b38db17c5fc554f54aed3f3fc1941279a04e Mon Sep 17 00:00:00 2001 From: hubaishan Date: Wed, 1 Nov 2017 08:48:21 +0300 Subject: [ticket/15433] Fix phpbbcli can enable non-existent extension Fix phpbbcli can enable non-existent extension PHPBB3-15433 --- phpBB/phpbb/console/command/extension/enable.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'phpBB/phpbb/console/command/extension/enable.php') diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index f92de0069c..a6f5b10e86 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -37,6 +37,13 @@ class enable extends command $io = new SymfonyStyle($input, $output); $name = $input->getArgument('extension-name'); + + if (!$this->manager->is_available($name)) + { + $io->error($this->user->lang('CLI_EXTENSION_NOT_EXIST', $name)); + return 1; + } + $extension = $this->manager->get_extension($name); if (!$extension->is_enableable()) -- cgit v1.2.1