From 079b3d074d905c1982ec22840caae808c3b588f3 Mon Sep 17 00:00:00 2001 From: Marc Alexander <admin@m-a-styles.de> Date: Tue, 10 Nov 2015 15:01:18 +0100 Subject: [PATCH 1/3] [ticket/14281] Fix installer CLI after recent changes PHPBB3-14281 --- phpBB/install/phpbbcli.php | 4 ++++ phpBB/language/en/install.php | 2 ++ phpBB/phpbb/install/console/command/install/config/show.php | 2 +- phpBB/phpbb/install/console/command/install/install.php | 4 ++-- 4 files changed, 9 insertions(+), 3 deletions(-) mode change 100644 => 100755 phpBB/install/phpbbcli.php diff --git a/phpBB/install/phpbbcli.php b/phpBB/install/phpbbcli.php old mode 100644 new mode 100755 index ecdb66ade3..e36922f1a5 --- a/phpBB/install/phpbbcli.php +++ b/phpBB/install/phpbbcli.php @@ -12,6 +12,8 @@ * */ +use Symfony\Component\Console\Input\ArgvInput; + if (php_sapi_name() !== 'cli') { echo 'This program must be run from the command line.' . PHP_EOL; @@ -31,6 +33,8 @@ $startup_new_path = $phpbb_root_path . 'install/update/update/new/install/startu $startup_path = (file_exists($startup_new_path)) ? $startup_new_path : $phpbb_root_path . 'install/startup.' . $phpEx; require($startup_path); +$input = new ArgvInput(); + /** @var \phpbb\filesystem\filesystem $phpbb_filesystem */ $phpbb_filesystem = $phpbb_installer_container->get('filesystem'); diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index a42e868aee..6097bd66bb 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -312,6 +312,8 @@ $lang = array_merge($lang, array( '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', + 'MISSING_FILE' => 'Unable to access file %1$s', + 'INVALID_YAML_FILE' => 'Could not parse YAML file %1$s', )); // Common updater messages diff --git a/phpBB/phpbb/install/console/command/install/config/show.php b/phpBB/phpbb/install/console/command/install/config/show.php index 4155440fc3..587b5f4846 100644 --- a/phpBB/phpbb/install/console/command/install/config/show.php +++ b/phpBB/phpbb/install/console/command/install/config/show.php @@ -96,7 +96,7 @@ class show extends \phpbb\console\command\command if (!is_file($config_file)) { - $iohandler->add_error_message(array('MISSING_FILE', array($config_file))); + $iohandler->add_error_message('MISSING_FILE', array($config_file)); return; } diff --git a/phpBB/phpbb/install/console/command/install/install.php b/phpBB/phpbb/install/console/command/install/install.php index 81ad1039f6..d76182af92 100644 --- a/phpBB/phpbb/install/console/command/install/install.php +++ b/phpBB/phpbb/install/console/command/install/install.php @@ -116,7 +116,7 @@ class install extends \phpbb\console\command\command if (!is_file($config_file)) { - $iohandler->add_error_message(array('MISSING_FILE', array($config_file))); + $iohandler->add_error_message(array('MISSING_FILE', $config_file)); return 1; } @@ -127,7 +127,7 @@ class install extends \phpbb\console\command\command } catch (ParseException $e) { - $iohandler->add_error_message('INVALID_YAML_FILE'); + $iohandler->add_error_message(array('INVALID_YAML_FILE', $config_file)); return 1; } From a1abf8253f2328f0a5c7b8d7c5885c6cec93f547 Mon Sep 17 00:00:00 2001 From: Marc Alexander <admin@m-a-styles.de> Date: Tue, 10 Nov 2015 16:49:30 +0100 Subject: [PATCH 2/3] [ticket/14281] Correctly pass parameters to add_error_message PHPBB3-14281 --- phpBB/phpbb/install/console/command/install/config/show.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/install/console/command/install/config/show.php b/phpBB/phpbb/install/console/command/install/config/show.php index 587b5f4846..5d82d8d1ef 100644 --- a/phpBB/phpbb/install/console/command/install/config/show.php +++ b/phpBB/phpbb/install/console/command/install/config/show.php @@ -96,7 +96,7 @@ class show extends \phpbb\console\command\command if (!is_file($config_file)) { - $iohandler->add_error_message('MISSING_FILE', array($config_file)); + $iohandler->add_error_message(array('MISSING_FILE', $config_file)); return; } From a6acbc445e58bbc42080f5c77c0671a5c9c01060 Mon Sep 17 00:00:00 2001 From: Marc Alexander <admin@m-a-styles.de> Date: Tue, 10 Nov 2015 16:57:25 +0100 Subject: [PATCH 3/3] [ticket/14281] Add install/phpbbcli.php to executable files list PHPBB3-14281 --- travis/check-executable-files.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/check-executable-files.sh b/travis/check-executable-files.sh index 4ec037e6ce..1aa8dca073 100755 --- a/travis/check-executable-files.sh +++ b/travis/check-executable-files.sh @@ -28,7 +28,7 @@ then files_skipped="-false" # Files which have to be executable - executable_files="-path ${path}bin/*" + executable_files="-path ${path}bin/* -o -path ${path}install/phpbbcli.php" incorrect_files=$( \ find ${path} \