Skip to content

Commit ffe900c

Browse files
committed
[ticket/14492] Define extensions to install in config not via cli argument
PHPBB3-14492
1 parent 69dece6 commit ffe900c

7 files changed

Lines changed: 16 additions & 18 deletions

File tree

phpBB/docs/install-config.sample.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ installer:
3434
server_name: localhost
3535
server_port: 80
3636
script_path: /
37+
38+
extensions: ['phpbb/viglink']
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
updater:
22
type: all
3+
extensions: ['phpbb/viglink']

phpBB/language/en/install.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@
330330
$lang = array_merge($lang, array(
331331
'CLI_INSTALL_BOARD' => 'Install phpBB',
332332
'CLI_UPDATE_BOARD' => 'Update phpBB',
333-
'CLI_INSTALL_EXTENSIONS' => 'Extensions to install. Multiple extensions can be specified using a comma separated list.',
334333
'CLI_INSTALL_SHOW_CONFIG' => 'Show the configuration which will be used',
335334
'CLI_INSTALL_VALIDATE_CONFIG' => 'Validate a configuration file',
336335
'CLI_CONFIG_FILE' => 'Config file to use',

phpBB/phpbb/install/console/command/install/install.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ protected function configure()
8080
'config-file',
8181
InputArgument::REQUIRED,
8282
$this->language->lang('CLI_CONFIG_FILE'))
83-
->addArgument(
84-
'install-extensions',
85-
InputArgument::OPTIONAL,
86-
$this->language->lang('CLI_INSTALL_EXTENSIONS'))
8783
->setDescription($this->language->lang('CLI_INSTALL_BOARD'))
8884
;
8985
}
@@ -151,11 +147,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
151147
}
152148

153149
$this->register_configuration($iohandler, $config);
154-
$this->register_install_extensions($iohandler, $input);
155150

156151
try
157152
{
158153
$this->installer->run();
154+
return 0;
159155
}
160156
catch (installer_exception $e)
161157
{
@@ -208,18 +204,7 @@ private function register_configuration(cli_iohandler $iohandler, $config)
208204
$iohandler->set_input('server_port', $config['server']['server_port']);
209205
$iohandler->set_input('script_path', $config['server']['script_path']);
210206
$iohandler->set_input('submit_server', 'submit');
211-
}
212207

213-
/**
214-
* Register extensions to install during installation
215-
*
216-
* @param cli_iohandler $iohandler
217-
* @param InputInterface $input
218-
*/
219-
private function register_install_extensions(cli_iohandler $iohandler, InputInterface $input)
220-
{
221-
$install_extensions = $input->getArgument('install-extensions');
222-
$install_extensions = !empty($install_extensions) ? explode(',', $install_extensions) : array();
223-
$iohandler->set_input('install-extensions', $install_extensions);
208+
$iohandler->set_input('install-extensions', $config['extensions']);
224209
}
225210
}

phpBB/phpbb/install/console/command/update/update.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
151151
try
152152
{
153153
$this->installer->run();
154+
return 0;
154155
}
155156
catch (installer_exception $e)
156157
{
@@ -175,5 +176,7 @@ private function register_configuration(cli_iohandler $iohandler, $config)
175176
$iohandler->set_input('submit_update_file', 'submit');
176177

177178
$iohandler->set_input('submit_continue_file_update', 'submit');
179+
180+
$iohandler->set_input('update-extensions', $config['extensions']);
178181
}
179182
}

phpBB/phpbb/install/installer_configuration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ public function getConfigTreeBuilder()
136136
->end()
137137
->end()
138138
->end()
139+
->arrayNode('extensions')
140+
->prototype('scalar')->end()
141+
->defaultValue([])
142+
->end()
139143
->end()
140144
;
141145
return $treeBuilder;

phpBB/phpbb/install/updater_configuration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ public function getConfigTreeBuilder()
3232
->addDefaultsIfNotSet()
3333
->children()
3434
->enumNode('type')->values(['all','db_only'])->defaultValue('all')->end()
35+
->arrayNode('extensions')
36+
->prototype('scalar')->end()
37+
->defaultValue([])
38+
->end()
3539
->end()
3640
;
3741

0 commit comments

Comments
 (0)