Skip to content

Commit

Permalink
[ticket/15433] Fix phpbbcli can enable non-existent extension
Browse files Browse the repository at this point in the history
Fix phpbbcli can enable non-existent extension

PHPBB3-15433
  • Loading branch information
hubaishan authored and marc1706 committed Dec 3, 2017
1 parent 131c264 commit 03b3b38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions phpBB/language/en/cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
'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',
Expand Down
7 changes: 7 additions & 0 deletions phpBB/phpbb/console/command/extension/enable.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
$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())
Expand Down

0 comments on commit 03b3b38

Please sign in to comment.