mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-22 16:40:21 +01: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:
commit
9c0bb4afb5
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user