1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-15 14:16:28 +02:00

Merge pull request #4927 from rubencm/ticket/15349

[ticket/15349] Check if an extension if enableable before enable with CLI
This commit is contained in:
Máté Bartus
2017-09-07 14:08:14 +02:00
committed by GitHub

View File

@ -37,11 +37,18 @@ 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))
{
$io->error($this->user->lang('CLI_EXTENSION_ENABLED', $name));
return 2;
return 1;
}
$this->manager->enable($name);