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

[ticket/14492] Define extensions to install in config not via cli argument

PHPBB3-14492
This commit is contained in:
Marc Alexander 2016-03-02 11:53:20 +01:00
parent 69dece6197
commit ffe900c72d
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
7 changed files with 16 additions and 18 deletions

View File

@ -34,3 +34,5 @@ installer:
server_name: localhost
server_port: 80
script_path: /
extensions: ['phpbb/viglink']

View File

@ -1,2 +1,3 @@
updater:
type: all
extensions: ['phpbb/viglink']

View File

@ -330,7 +330,6 @@ $lang = array_merge($lang, array(
$lang = array_merge($lang, array(
'CLI_INSTALL_BOARD' => 'Install 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_VALIDATE_CONFIG' => 'Validate a configuration file',
'CLI_CONFIG_FILE' => 'Config file to use',

View File

@ -80,10 +80,6 @@ class install extends \phpbb\console\command\command
'config-file',
InputArgument::REQUIRED,
$this->language->lang('CLI_CONFIG_FILE'))
->addArgument(
'install-extensions',
InputArgument::OPTIONAL,
$this->language->lang('CLI_INSTALL_EXTENSIONS'))
->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_install_extensions($iohandler, $input);
try
{
$this->installer->run();
return 0;
}
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('script_path', $config['server']['script_path']);
$iohandler->set_input('submit_server', 'submit');
}
/**
* 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);
$iohandler->set_input('install-extensions', $config['extensions']);
}
}

View File

@ -151,6 +151,7 @@ class update extends \phpbb\console\command\command
try
{
$this->installer->run();
return 0;
}
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_continue_file_update', 'submit');
$iohandler->set_input('update-extensions', $config['extensions']);
}
}

View File

@ -136,6 +136,10 @@ class installer_configuration implements ConfigurationInterface
->end()
->end()
->end()
->arrayNode('extensions')
->prototype('scalar')->end()
->defaultValue([])
->end()
->end()
;
return $treeBuilder;

View File

@ -32,6 +32,10 @@ class updater_configuration implements ConfigurationInterface
->addDefaultsIfNotSet()
->children()
->enumNode('type')->values(['all','db_only'])->defaultValue('all')->end()
->arrayNode('extensions')
->prototype('scalar')->end()
->defaultValue([])
->end()
->end()
;