Skip to content

Dependency conflict with psr/simple-cache causing installation failure #11

@Tarom11

Description

@Tarom11

Summary

The package mrcnpdlk/regon-api version 2.0.0 requires psr/simple-cache ^1 which conflicts with other modern packages that require psr/simple-cache ^2 or ^3, making it impossible to install the package in current PHP projects.

Environment

  • PHP Version: 8.1+ (modern environment)
  • Composer Version: Latest
  • mrcnpdlk/regon-api Version: 2.0.0
  • Conflicting packages: mobiledetect/mobiledetectlib ^4.8

Error Message

Your requirements could not be resolved to an installable set of packages.

Problem 1
  - Root composer.json requires mobiledetect/mobiledetectlib ^4.8 -> satisfiable by mobiledetect/mobiledetectlib[4.8.01, ..., 4.8.09].
  - Root composer.json requires mrcnpdlk/regon-api ^2.0 -> satisfiable by mrcnpdlk/regon-api[2.0.0].
  - mobiledetect/mobiledetectlib[4.8.01, ..., 4.8.05] require psr/simple-cache ^3.0 -> satisfiable by psr/simple-cache[3.0.0].
  - mobiledetect/mobiledetectlib[4.8.06, ..., 4.8.07] require psr/simple-cache ^2 || ^3 -> satisfiable by psr/simple-cache[2.0.0, 3.0.0].
  - mobiledetect/mobiledetectlib[4.8.08, ..., 4.8.09] require psr/simple-cache ^3 -> satisfiable by psr/simple-cache[3.0.0].
  - mrcnpdlk/regon-api 2.0.0 requires psr/simple-cache ^1 -> satisfiable by psr/simple-cache[1.0.0, 1.0.1].
  - You can only install one version of a package, so only one of these can be installed: psr/simple-cache[1.0.0, 1.0.1, 2.0.0, 3.0.0].

Steps to Reproduce

  1. Create a new PHP project with Composer
  2. Add mrcnpdlk/regon-api: "^2.0" to composer.json
  3. Add mobiledetect/mobiledetectlib: "^4.8" to composer.json (or any other modern package requiring psr/simple-cache ^2 or ^3)
  4. Run composer install or composer update
  5. Observe the dependency conflict error

Current composer.json requirements

{
    "require": {
        "mrcnpdlk/regon-api": "^2.0",
        "mobiledetect/mobiledetectlib": "^4.8"
    }
}

Expected Behavior

The package should be installable alongside other modern PHP packages without dependency conflicts.

Proposed Solution

Update the composer.json of mrcnpdlk/regon-api to support newer versions of psr/simple-cache:

{
    "require": {
        "psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
    }
}

This would maintain backward compatibility while allowing the package to work with modern dependencies.

Workarounds

Currently, users need to either:

  1. Use composer update --with-all-dependencies -W (may cause other issues)
  2. Switch to alternative packages like gusapi/gusapi
  3. Remove conflicting packages

Impact

This issue prevents the package from being used in modern PHP applications, limiting its adoption and forcing developers to seek alternatives.

Additional Context

  • PSR-16 (Simple Cache) version 1.0 was released in 2017
  • Most modern packages have moved to psr/simple-cache ^2.0 or ^3.0
  • This conflict is becoming increasingly common as the PHP ecosystem evolves

Thank you for maintaining this package! A fix for this dependency conflict would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions