From 8a96ec85517caac25864a03306b1efb9d027a882 Mon Sep 17 00:00:00 2001 From: Mark Clements Date: Mon, 2 Mar 2015 22:49:22 +0000 Subject: [PATCH] Fixed the install script, which bails-out with an error if the PHPCI path contains spaces. This occurs commonly on Windows, but from my reading of the code it would also be a problem on other platforms if spaces were present (though this is less likely, due to different naming conventions). It has been fixed by using escapeshellarg() on both of the paths used in the command. Fixes #698, which I've just noticed has a similar solution suggested in one of the comments, but was closed without anyone actually implementing it. --- PHPCI/Command/InstallCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PHPCI/Command/InstallCommand.php b/PHPCI/Command/InstallCommand.php index 04e0f2dd..a50eefec 100644 --- a/PHPCI/Command/InstallCommand.php +++ b/PHPCI/Command/InstallCommand.php @@ -323,7 +323,9 @@ class InstallCommand extends Command { $output->write(Lang::get('setting_up_db')); - shell_exec(PHPCI_DIR . 'vendor/bin/phinx migrate -c "' . PHPCI_DIR . 'phinx.php"'); + $phinxBinary = escapeshellarg(PHPCI_DIR . 'vendor/bin/phinx'); + $phinxScript = escapeshellarg(PHPCI_DIR . 'phinx.php'); + shell_exec($phinxBinary . ' migrate -c ' . $phinxScript); $output->writeln(''.Lang::get('ok').''); }