swayok / alternative-laravel-cache

Replacements for Laravel's redis and file cache stores that properly implement tagging idea
MIT License
169 stars 26 forks source link

Not compatible with dependencies of Laravel 10.24.0 #46

Closed Henning256 closed 8 months ago

Henning256 commented 1 year ago

Hi,

I went into trouble installing your packet. I updated my Laravel 10 project (laravel/framework v10.24.0)

$ composer update
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
83 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found.

and tried to install your package

$ composer require swayok/alternative-laravel-cache:*
./composer.json has been updated
Running composer update swayok/alternative-laravel-cache
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - swayok/alternative-laravel-cache[5.3.1, ..., 5.4.7] require cache/predis-adapter ^0.4.0 -> satisfiable by cache/predis-adapter[0.4.0, 0.4.1, 0.4.2].
    - swayok/alternative-laravel-cache[5.4.10, ..., 5.4.12] require cache/predis-adapter ^1.0.0 -> satisfiable by cache/predis-adapter[1.0.0, 1.1.0, 1.2.0].
    - swayok/alternative-laravel-cache[6.1.5, ..., 6.1.12] require cache/adapter-common ^1.0.0 -> satisfiable by cache/adapter-common[1.0.0, 1.1.0, 1.2.0, 1.3.0].
    - cache/predis-adapter 0.4.0 requires php ^5.5|^7.0 -> your php version (8.1.2) does not satisfy that requirement.
    - cache/predis-adapter[0.4.1, ..., 0.4.2] require php ^5.5 || ^7.0 -> your php version (8.1.2) does not satisfy that requirement.
    - swayok/alternative-laravel-cache[5.4.8, ..., 5.4.9] require laravel/framework 5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0 -> found laravel/framework[v5.2.0, ..., v5.8.38, v6.0.0, ..., v6.20.44] but it conflicts with your root composer.json require (^10).
    - cache/predis-adapter 1.0.0 requires php ^5.6 || ^7.0 -> your php version (8.1.2) does not satisfy that requirement.
    - swayok/alternative-laravel-cache 5.4.13 requires php ^5.6 || ^7.0 -> your php version (8.1.2) does not satisfy that requirement.
    - cache/adapter-common[1.0.0, ..., 1.1.0] require php ^5.6 || ^7.0 -> your php version (8.1.2) does not satisfy that requirement.
    - cache/predis-adapter[1.1.0, ..., 1.2.0] 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.
    - cache/adapter-common 1.3.0 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.
    - swayok/alternative-laravel-cache[6.0.0, ..., 6.1.4] require psr/simple-cache ^1.0.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.
    - cache/adapter-common 1.2.0 requires 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.
    - Root composer.json requires swayok/alternative-laravel-cache * -> satisfiable by swayok/alternative-laravel-cache[5.3.1, ..., 5.4.13, 6.0.0, ..., 6.1.12].

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.

but it is not possible because of conflicting requirements. Is this something I would have do deal with after every other update if I manage to install this into my project?

Don't get me wrong. The original implementation does not make sense. I just have to take responsibility in my company for each additional dependency I bring in...

Cheers Henning

swayok commented 1 year ago

Hi. Package depends on some other packages that are not really often update to latest versions of psr/*, unfortunately.

Try to delete composer.lock file - it seems that main issue is psr/* packages and in most cases packages support several versions of psr/*. I'm currently on Laravel 10.24 with php_redis extension (cache/redis-adapter package) and everything works fine, so problem might be in composer.lock.

Also consider using php_redis extension and cache/redis-adapter - extension is much faster and more stable than predis (I've tested and moved to extension and never had any issues for years now).

I'm going to try to move to Symfony cache in future - it seems that tagging works like expected there, but I had no time to research this.

fd6130 commented 1 year ago

Just follow README and manually add the require in composer.json should be fine.

"require": {
    "swayok/alternative-laravel-cache": "6.1.*"
}

And don't forget to enable PHP ZIP extension before install.