tuupola / slim-basic-auth

PSR-7 and PSR-15 HTTP Basic Authentication Middleware
MIT License
440 stars 66 forks source link

Uncaught Error: Interface 'Psr\Http\Message\ResponseFactoryInterface' not found #108

Closed X-Tender closed 3 years ago

X-Tender commented 3 years ago

I know this kind of Issue was already created but I couldn't solve it. When I try to install this package composer do this:

Using version ^3.3 for tuupola/slim-basic-auth
./composer.json has been updated
Running composer update tuupola/slim-basic-auth
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 1 removal
  - Removing psr/http-factory (1.0.1)
  - Locking tuupola/slim-basic-auth (3.3.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 1 removal
  - Downloading tuupola/slim-basic-auth (3.3.1)
  - Removing psr/http-factory (1.0.1)
  - Installing tuupola/slim-basic-auth (3.3.1): Extracting archive
Generating autoload files
1 package you are using is looking for funding.
Use the `composer fund` command to find out more!

Why is he removing the http-factory? When I try to re-add it he just tells me:

Using version ^1.0 for psr/http-factory
./composer.json has been updated
Running composer update psr/http-factory
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove

These are my composer packages I use:

"slim/slim": "4.*",
"symfony/var-dumper": "^5.0",
"vlucas/phpdotenv": "^4.1",
"slim/psr7": "^1.0",
"slim/twig-view": "3.0.0-beta",
"league/container": "^3.3",
"slim/http": "^1.0",
"illuminate/database": "^6.16",
"robmorgan/phinx": "^0.11.4",
"slim/flash": "^0.4.0",
"tuupola/slim-jwt-auth": "^3.4",
"dflydev/dot-access-data": "^2.0",
"dflydev/fig-cookies": "^2.0",
"firebase/php-jwt": "^5.0",
"zeuxisoo/slim-whoops": "^0.7.2"
tuupola commented 3 years ago

You need to have latest for both tuupola/slim-jwt-auth and tuupola/slim-basic-auth to avoid the problem there was with Composer 2 and tuupola/http-factory.

https://github.com/tuupola/slim-basic-auth/blob/3.x/CHANGELOG.md https://github.com/tuupola/slim-jwt-auth/blob/3.x/CHANGELOG.md

Or alternatively I think you can also manually update only tuupola/http-factory to at least 1.0.2.

https://github.com/tuupola/http-factory/blob/master/CHANGELOG.md#102---2018-12-22

In short there was a problem with the provides clause here https://github.com/tuupola/http-factory/commit/4462700ad9ab90f3fb2a98e52ad1948ea9bfd07b but it did not affect Composer 1. However with Composer 2 this bug caused psr/http-factory to uninstall.

X-Tender commented 3 years ago

Thank you for the response, it wasn't exactly that. I basicly reinstalled my packages one after the other (starting with illuminate and force league to ^3) after that everything went fine.