diff options
author | Marc Alexander <admin@m-a-styles.de> | 2017-12-03 17:49:39 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2017-12-03 17:49:39 +0100 |
commit | 551c3fd511b75b4a2e55e0f4fb55c42731bd1369 (patch) | |
tree | af03447063c600e9b81494f0026a6a6c9a990a8c /phpBB | |
parent | b66b497429dfb1cc7a2ea56a022faf96c33d86dd (diff) | |
parent | 03b3b38db17c5fc554f54aed3f3fc1941279a04e (diff) | |
download | forums-551c3fd511b75b4a2e55e0f4fb55c42731bd1369.tar forums-551c3fd511b75b4a2e55e0f4fb55c42731bd1369.tar.gz forums-551c3fd511b75b4a2e55e0f4fb55c42731bd1369.tar.bz2 forums-551c3fd511b75b4a2e55e0f4fb55c42731bd1369.tar.xz forums-551c3fd511b75b4a2e55e0f4fb55c42731bd1369.zip |
Merge pull request #5025 from hubaishan/ticket/15433
[ticket/15433] Fix phpbbcli can enable non-existent extension
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/language/en/cli.php | 1 | ||||
-rw-r--r-- | phpBB/phpbb/console/command/extension/enable.php | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/phpBB/language/en/cli.php b/phpBB/language/en/cli.php index 1655855edb..505d12e8ff 100644 --- a/phpBB/language/en/cli.php +++ b/phpBB/language/en/cli.php @@ -117,6 +117,7 @@ $lang = array_merge($lang, array( 'CLI_EXTENSION_ENABLE_FAILURE' => 'Could not enable extension %s', 'CLI_EXTENSION_ENABLE_SUCCESS' => 'Successfully enabled extension %s', 'CLI_EXTENSION_ENABLED' => 'Extension %s is already enabled', + 'CLI_EXTENSION_NOT_EXIST' => 'Extension %s does not exist', 'CLI_EXTENSION_NAME' => 'Name of the extension', 'CLI_EXTENSION_PURGE_FAILURE' => 'Could not purge extension %s', 'CLI_EXTENSION_PURGE_SUCCESS' => 'Successfully purged extension %s', 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()) |