aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/console/command/extension
diff options
context:
space:
mode:
authorRubén Calvo <rubencm@gmail.com>2017-03-11 20:34:40 +0100
committerRubén Calvo <rubencm@gmail.com>2017-03-13 22:20:20 +0100
commit891aab05935e9ebc237a83cef0b248998cb5fccf (patch)
treebda2dd6d822a7fb9773fe95b86839ee637928636 /phpBB/phpbb/console/command/extension
parent5d597787eb49e202eec198d6b6416fb69ef15e3e (diff)
downloadforums-891aab05935e9ebc237a83cef0b248998cb5fccf.tar
forums-891aab05935e9ebc237a83cef0b248998cb5fccf.tar.gz
forums-891aab05935e9ebc237a83cef0b248998cb5fccf.tar.bz2
forums-891aab05935e9ebc237a83cef0b248998cb5fccf.tar.xz
forums-891aab05935e9ebc237a83cef0b248998cb5fccf.zip
[ticket/15123] add check before enable or disable extension
PHPBB3-15123
Diffstat (limited to 'phpBB/phpbb/console/command/extension')
-rw-r--r--phpBB/phpbb/console/command/extension/disable.php7
-rw-r--r--phpBB/phpbb/console/command/extension/enable.php7
2 files changed, 14 insertions, 0 deletions
diff --git a/phpBB/phpbb/console/command/extension/disable.php b/phpBB/phpbb/console/command/extension/disable.php
index d022755753..be5c77a9a0 100644
--- a/phpBB/phpbb/console/command/extension/disable.php
+++ b/phpBB/phpbb/console/command/extension/disable.php
@@ -37,6 +37,13 @@ class disable 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_DISABLED', $name));
+ return 1;
+ }
+
$this->manager->disable($name);
$this->manager->load_extensions();
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();