DirectoryTree / LdapRecord-Laravel

Multi-domain LDAP Authentication & Management for Laravel.
https://ldaprecord.com/docs/laravel/v3
MIT License
496 stars 52 forks source link

[Feature] Add support for psr/simple-cache 3.0.0 in build #504

Closed cxj closed 1 year ago

cxj commented 1 year ago

composer appears unable to resolve requiring this package in a totally fresh install of Laravel 9.45.1 and Laravel Breeze 1.16.1 with PHP 8.1, without forcing a downgrade of the psr/simple-cache package to version 2.0.0 from the default of 3.0.0.

Hopefully adding support is as easy as tweaking the composer.json file for this package, and doing so does not cause a cascade of other needed changes!

See below for verbose details. First, the dependency information.

746 ~/md/breeze$ composer why psr/simple-cache
directorytree/ldaprecord v2.19.1 requires psr/simple-cache (^1.0|^2.0)
laravel/framework        v9.45.1 requires psr/simple-cache (^1.0|^2.0|^3.0)

2 runs of Composer, one in default mode which fails. And one in -W, --update-with-all-dependencies mode, which is kind of an overly big hammer to use. 😉

744 ~/md/breeze$ composer require directorytree/ldaprecord-laravel
Info from https://repo.packagist.org: #StandWithUkraine
./composer.json has been updated
Running composer update directorytree/ldaprecord-laravel
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - directorytree/ldaprecord-laravel[dev-feature-db-transaction-import, dev-feature-laravel-sanctum-tests, dev-fix-env-config-cache, dev-fix-sqlsrv-support, dev-feature-import-scopes, dev-master, dev-laravel-9-support, v2.5.4, ..., v2.7.0] require directorytree/ldaprecord ^2.4.4 -> satisfiable by directorytree/ldaprecord[v2.4.4, ..., v2.19.1].
    - directorytree/ldaprecord-laravel[v1.0.0, ..., v1.0.2] require illuminate/support ^5.6|^6.0 -> found illuminate/support[v5.6.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev] but these were not loaded, likely because it conflicts with another require.
    - directorytree/ldaprecord-laravel[v1.0.3, ..., v1.7.0] require illuminate/support ^5.6|^6.0|^7.0 -> found illuminate/support[v5.6.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but these were not loaded, likely because it conflicts with another require.
    - directorytree/ldaprecord-laravel[dev-patch-php-8.1-support, v1.0.x-dev, ..., v1.7.6, v2.0.0, ..., v2.5.3] require illuminate/support ^5.6|^6.0|^7.0|^8.0 -> found illuminate/support[v5.6.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
    - directorytree/ldaprecord[v2.4.0, ..., v2.7.0] require psr/log ^1.0 -> found psr/log[1.0.0, ..., 1.1.4] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - directorytree/ldaprecord[v2.7.1, ..., v2.9.3] require psr/simple-cache ^1.0 -> found psr/simple-cache[1.0.0, 1.0.1] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - directorytree/ldaprecord[v2.9.4, ..., v2.19.1] require psr/simple-cache ^1.0|^2.0 -> found psr/simple-cache[1.0.0, 1.0.1, 2.0.0, 2.x-dev] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires directorytree/ldaprecord-laravel * -> satisfiable by directorytree/ldaprecord-laravel[dev-feature-db-transaction-import, dev-feature-laravel-sanctum-tests, dev-fix-env-config-cache, dev-fix-sqlsrv-support, dev-feature-import-scopes, dev-master, dev-laravel-9-support, dev-patch-php-8.1-support, v1.0.0, ..., v1.7.6, v2.0.0, ..., v2.7.0, 9999999-dev].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
master
745 ~/md/breeze$ composer require directorytree/ldaprecord-laravel -W
./composer.json has been updated
Running composer update directorytree/ldaprecord-laravel --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Lock file operations: 3 installs, 1 update, 0 removals
  - Locking directorytree/ldaprecord (v2.19.1)
  - Locking directorytree/ldaprecord-laravel (v2.7.0)
  - Downgrading psr/simple-cache (3.0.0 => 2.0.0)
  - Locking tightenco/collect (v8.83.25)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 3 installs, 1 update, 0 removals
  - Downloading tightenco/collect (v8.83.25)
  - Downloading directorytree/ldaprecord (v2.19.1)
  - Downloading directorytree/ldaprecord-laravel (v2.7.0)
  - Downgrading psr/simple-cache (3.0.0 => 2.0.0): Extracting archive
  - Installing tightenco/collect (v8.83.25): Extracting archive
  - Installing directorytree/ldaprecord (v2.19.1): Extracting archive
  - Installing directorytree/ldaprecord-laravel (v2.7.0): Extracting archive
Generating optimized autoload files
stevebauman commented 1 year ago

Hi @cxj!

Have you seen issue https://github.com/DirectoryTree/LdapRecord-Laravel/issues/392? PSR Simple Cache 3.0 contains breaking changes that are only compatible with PHP >= 8.0, while LdapRecord v2 targets PHP >= 7.3.

Due to this, we cannot bump simple-cache to 3.0 without a major LdapRecord version bump (which is already in the works and will be released in early January).

Does this answer your issue? Let me know!

Hope you’re having a good holiday! ❤️ 🎄

cxj commented 1 year ago

Ah, that of course makes perfect sense. Sorry I did not spot #392 in my perusal of existing potentially-related issues. Thanks, and happy holidays to you as well!