composer/composer — Issue #237: PHP Warning:  Invalid argument supplied for foreach() in ./src/Composer/Repository/Vcs/GitDriver.php on line 137
Author: jivoy1988
Created: 2012-01-20 14:53:01+00:00
State: open

if in composer.json:

...
"repositories": {
"ramka": {
"vcs": {
"url": "git://localhost/ramka.git"
}
}
},
...

And run: php ./bin/composer update -v
Then error:

PHP Warning: Invalid argument supplied for foreach() in /..../composer/src/Composer/Repository/Vcs/GitDriver.php on line 137

Warning: Invalid argument supplied for foreach() in /.../composer/src/Composer/Repository/Vcs/GitDriver.php on line 137
PHP Warning: Invalid argument supplied for foreach() in /.../composer/src/Composer/Repository/Vcs/GitDriver.php on line 51

Warning: Invalid argument supplied for foreach() in /.../composer/src/Composer/Repository/Vcs/GitDriver.php on line 51
PHP Warning: implode(): Invalid arguments passed in /.../composer/src/Composer/Repository/Vcs/GitDriver.php on line 95

Warning: implode(): Invalid arguments passed in /.../composer/src/Composer/Repository/Vcs/GitDriver.php on line 95

If in file: ./composer/src/Composer/Util/ProcessExecutor.php
Replace:

...
if (null !== $output) {
$output = $process->getOutput();
}
...

To:

...
$output = explode("\n", $process->getOutput());
...

Then ok %)