mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/14492] Define extensions to install in config not via cli argument
PHPBB3-14492
This commit is contained in:
parent
69dece6197
commit
ffe900c72d
7 changed files with 16 additions and 18 deletions
|
@ -34,3 +34,5 @@ installer:
|
||||||
server_name: localhost
|
server_name: localhost
|
||||||
server_port: 80
|
server_port: 80
|
||||||
script_path: /
|
script_path: /
|
||||||
|
|
||||||
|
extensions: ['phpbb/viglink']
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
updater:
|
updater:
|
||||||
type: all
|
type: all
|
||||||
|
extensions: ['phpbb/viglink']
|
||||||
|
|
|
@ -330,7 +330,6 @@ $lang = array_merge($lang, array(
|
||||||
$lang = array_merge($lang, array(
|
$lang = array_merge($lang, array(
|
||||||
'CLI_INSTALL_BOARD' => 'Install phpBB',
|
'CLI_INSTALL_BOARD' => 'Install phpBB',
|
||||||
'CLI_UPDATE_BOARD' => 'Update phpBB',
|
'CLI_UPDATE_BOARD' => 'Update phpBB',
|
||||||
'CLI_INSTALL_EXTENSIONS' => 'Extensions to install. Multiple extensions can be specified using a comma separated list.',
|
|
||||||
'CLI_INSTALL_SHOW_CONFIG' => 'Show the configuration which will be used',
|
'CLI_INSTALL_SHOW_CONFIG' => 'Show the configuration which will be used',
|
||||||
'CLI_INSTALL_VALIDATE_CONFIG' => 'Validate a configuration file',
|
'CLI_INSTALL_VALIDATE_CONFIG' => 'Validate a configuration file',
|
||||||
'CLI_CONFIG_FILE' => 'Config file to use',
|
'CLI_CONFIG_FILE' => 'Config file to use',
|
||||||
|
|
|
@ -80,10 +80,6 @@ class install extends \phpbb\console\command\command
|
||||||
'config-file',
|
'config-file',
|
||||||
InputArgument::REQUIRED,
|
InputArgument::REQUIRED,
|
||||||
$this->language->lang('CLI_CONFIG_FILE'))
|
$this->language->lang('CLI_CONFIG_FILE'))
|
||||||
->addArgument(
|
|
||||||
'install-extensions',
|
|
||||||
InputArgument::OPTIONAL,
|
|
||||||
$this->language->lang('CLI_INSTALL_EXTENSIONS'))
|
|
||||||
->setDescription($this->language->lang('CLI_INSTALL_BOARD'))
|
->setDescription($this->language->lang('CLI_INSTALL_BOARD'))
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
@ -151,11 +147,11 @@ class install extends \phpbb\console\command\command
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->register_configuration($iohandler, $config);
|
$this->register_configuration($iohandler, $config);
|
||||||
$this->register_install_extensions($iohandler, $input);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$this->installer->run();
|
$this->installer->run();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
catch (installer_exception $e)
|
catch (installer_exception $e)
|
||||||
{
|
{
|
||||||
|
@ -208,18 +204,7 @@ class install extends \phpbb\console\command\command
|
||||||
$iohandler->set_input('server_port', $config['server']['server_port']);
|
$iohandler->set_input('server_port', $config['server']['server_port']);
|
||||||
$iohandler->set_input('script_path', $config['server']['script_path']);
|
$iohandler->set_input('script_path', $config['server']['script_path']);
|
||||||
$iohandler->set_input('submit_server', 'submit');
|
$iohandler->set_input('submit_server', 'submit');
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
$iohandler->set_input('install-extensions', $config['extensions']);
|
||||||
* Register extensions to install during installation
|
|
||||||
*
|
|
||||||
* @param cli_iohandler $iohandler
|
|
||||||
* @param InputInterface $input
|
|
||||||
*/
|
|
||||||
private function register_install_extensions(cli_iohandler $iohandler, InputInterface $input)
|
|
||||||
{
|
|
||||||
$install_extensions = $input->getArgument('install-extensions');
|
|
||||||
$install_extensions = !empty($install_extensions) ? explode(',', $install_extensions) : array();
|
|
||||||
$iohandler->set_input('install-extensions', $install_extensions);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,6 +151,7 @@ class update extends \phpbb\console\command\command
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$this->installer->run();
|
$this->installer->run();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
catch (installer_exception $e)
|
catch (installer_exception $e)
|
||||||
{
|
{
|
||||||
|
@ -175,5 +176,7 @@ class update extends \phpbb\console\command\command
|
||||||
$iohandler->set_input('submit_update_file', 'submit');
|
$iohandler->set_input('submit_update_file', 'submit');
|
||||||
|
|
||||||
$iohandler->set_input('submit_continue_file_update', 'submit');
|
$iohandler->set_input('submit_continue_file_update', 'submit');
|
||||||
|
|
||||||
|
$iohandler->set_input('update-extensions', $config['extensions']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,6 +136,10 @@ class installer_configuration implements ConfigurationInterface
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
|
->arrayNode('extensions')
|
||||||
|
->prototype('scalar')->end()
|
||||||
|
->defaultValue([])
|
||||||
|
->end()
|
||||||
->end()
|
->end()
|
||||||
;
|
;
|
||||||
return $treeBuilder;
|
return $treeBuilder;
|
||||||
|
|
|
@ -32,6 +32,10 @@ class updater_configuration implements ConfigurationInterface
|
||||||
->addDefaultsIfNotSet()
|
->addDefaultsIfNotSet()
|
||||||
->children()
|
->children()
|
||||||
->enumNode('type')->values(['all','db_only'])->defaultValue('all')->end()
|
->enumNode('type')->values(['all','db_only'])->defaultValue('all')->end()
|
||||||
|
->arrayNode('extensions')
|
||||||
|
->prototype('scalar')->end()
|
||||||
|
->defaultValue([])
|
||||||
|
->end()
|
||||||
->end()
|
->end()
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue