Merge pull request #4924 from rubencm/ticket/15346

[ticket/15346] Check if extension is enableable during install
This commit is contained in:
Máté Bartus 2017-09-07 14:12:18 +02:00 committed by GitHub
commit 384ece3621
2 changed files with 9 additions and 0 deletions

View file

@ -123,6 +123,7 @@ $lang = array_merge($lang, array(
'CLI_EXTENSION_UPDATE_FAILURE' => 'Could not update extension %s',
'CLI_EXTENSION_UPDATE_SUCCESS' => 'Successfully updated extension %s',
'CLI_EXTENSION_NOT_FOUND' => 'No extensions were found.',
'CLI_EXTENSION_NOT_ENABLEABLE' => 'Extension %s is not enableable.',
'CLI_EXTENSIONS_AVAILABLE' => 'Available',
'CLI_EXTENSIONS_DISABLED' => 'Disabled',
'CLI_EXTENSIONS_ENABLED' => 'Enabled',

View file

@ -118,6 +118,14 @@ class install_extensions extends \phpbb\install\task_base
try
{
$extension = $this->extension_manager->get_extension($ext_name);
if (!$extension->is_enableable())
{
$this->iohandler->add_log_message(array('CLI_EXTENSION_NOT_ENABLEABLE', $ext_name));
continue;
}
$this->extension_manager->enable($ext_name);
$extensions = $this->get_extensions();