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.
This commit is contained in:
Mark Clements 2015-03-02 22:49:22 +00:00
parent b8983b23a3
commit 8a96ec8551

View file

@ -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('<info>'.Lang::get('ok').'</info>');
}