0
votes

I have a composer.json that require multiple packages depending on psr/http-factory.

Somehow, composer update/install run without error, but the folder in vendor and class is missing.

In the cache, I can see '.cache/composer/repo/https---repo.packagist.org/provider-psr~http-factory.json' but nothing related in the .cache/composer/files or .cache/composer/vcs folder.

Running composer require psr/http-factory run with no problems. But the package is still missing.

Running composer show --tree list 'psr/http-factory ^1.0' as dependency.

I cleaned the composer.json to only "require": { "slim/slim": "^4.0", "slim/http": "^0.8.0" }

Slim's composer.json contains "require": { "php": "^7.2", "ext-json": "*", "nikic/fast-route": "^1.3", "psr/container": "^1.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.0", "psr/http-server-handler": "^1.0", "psr/http-server-middleware": "^1.0", "psr/log": "^1.1" }

Running install shows: Installs: psr/log:1.1.3, psr/http-message:1.0.1, psr/http-server-handler:1.0.1, psr/http-server-middleware:1.0.1, slim/http:0.8, psr/container:1.0.0, nikic/fast-route:v1.3.0, slim/slim:4.6.0 Looks like psr/http-factory is ignored...

I am at a lost... any pointer would be appreciated.

Thanks.

1
Yeah obviously, "slim/http": "^0.8.0" was the problem. Removing the package returns http-factory. ` - Removing slim/http (0.8) - Installing psr/http-factory (1.0.1): Extracting archive` Funny that there is no warning ... I do not get why adding slim/http removes psr/http-factory. Is there something in composer points to that?Fred

1 Answers

2
votes

As you can see on packagist, v0.8 of slim/http is configured to provide psr/http-factory - that means, by installing the first package, no second package needs to be installed.

v1.1.0 fixes this through.