These are chat archives for composer/composer

6th
Dec 2016
Henrik Thesing
@henrikthesing
Dec 06 2016 09:56
Good morning, I am facing problems with the composer. It throws an error "[ErrorException] Invalid argument supplied for foreach()" even if i download the installer from getcomposer.org and only run "php composer.phar" without any option. Anyone have the same problem?
Owen Melbourne
@OwenMelbz
Dec 06 2016 09:57
what version of php you running on the command line? and the OS might effect something
Henrik Thesing
@henrikthesing
Dec 06 2016 09:57
@OwenMelbz PHP 5.4.45 (cli) (built: Aug 16 2016 17:57:43)
Linux version 3.2.0-4-amd64 (debian-kernel@lists.debian.org)
Rob
@alcohol
Dec 06 2016 09:58
can you give us more details about the error?
did you run it in verbose mode?
Owen Melbourne
@OwenMelbz
Dec 06 2016 10:00
whats composer custom directory? is that a package you've tried to install?
Henrik Thesing
@henrikthesing
Dec 06 2016 10:00
yes, "mnsami/composer-custom-directory-installer": "1.0.*",
Owen Melbourne
@OwenMelbz
Dec 06 2016 10:01
if you remove it, does it work
as might be a dodgy package
and I think composer comes built in with its own custom install directories, so would probably use that instead of a 3rd party package
Rob
@alcohol
Dec 06 2016 10:01
looks to me like there is an error in that custom installer
Henrik Thesing
@henrikthesing
Dec 06 2016 10:03
I will try to remove it, but the composer throws this error even if I run it without an option just to get the list of available commands. This means that the composer will read an available composer.json even if no option is given
Rob
@alcohol
Dec 06 2016 10:03
yes composer always reads the composer.json
if it is available
Henrik Thesing
@henrikthesing
Dec 06 2016 10:04
ok good to know. It works if I remove the mentioned package above. I will investigate why this is the case. Thanks for your help!
Owen Melbourne
@OwenMelbz
Dec 06 2016 10:05
maybe consider what that package is trying to do, and see if you can do it without it
as you can install composer into custom dirs, you can install its binarys into custom dirs, you can modify the vendor folder location/name etc, so it might be you dont need a custom package for this
Henrik Thesing
@henrikthesing
Dec 06 2016 10:06
it moves specific packages from the vendor folder to another folder due to some backwards compatibility
Henrik Thesing
@henrikthesing
Dec 06 2016 10:06
I will have a look at it
I finally found the mistake. It was located in the composer.json.
Rob
@alcohol
Dec 06 2016 10:11
yes that would have been my guess
i forgot to ask you to share your composer.json with us
Henrik Thesing
@henrikthesing
Dec 06 2016 10:13
somebody added the "minimum-stability": "dev" part into the array definition of the "extra": { "installer-paths" which will lead to a valid json file but is not iteratable
thanks for your support :D