Skip to content

chore: support psr/cache:2 compatibility layer #833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 27, 2021

Conversation

bshaffer
Copy link
Contributor

@bshaffer bshaffer commented Sep 24, 2021

Proposed changes

Adds support the psr/cache:2 compatibility layer. This will allow projects which are still on psr/cache:1 to be installed alongside this library on PHP 8.

Any library which supports psr/cache:1 can support psr/cache:2, and any library that can support psr/cache:3 can also support psr/cache:2, without breaking anyone or making any changes. This allows everyone to coexist until they can add support for psr/cache:3

See googleapis/google-auth-library-php#363 for an example of the issue which takes place now, and why we cannot easily fix it.

Types of changes

What types of changes does your code introduce to Phpfastcache?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves an existing code/behavior)
  • Deprecated third party dependency update
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation/Typo/Resource update that does not involve any code modification

Agreement

I have read the CONTRIBUTING and CODING GUIDELINE docs

@Geolim4
Copy link
Member

Geolim4 commented Sep 24, 2021

Hello @bshaffer,

I already tried to support both version but its not working neither, I think that there is one more blocking dependency: google/grpc-gcp which require psr/cache ^1.0.1

E:\wamp\www\phpfastcache>composer require google/cloud-firestore
Using version ^1.20 for google/cloud-firestore
./composer.json has been updated
Running composer update google/cloud-firestore
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - google/grpc-gcp[0.1.0, ..., 0.1.5] require psr/cache ^1.0.1 -> found psr/cache[1.
0.1] but it conflicts with your root composer.json require (2.0).
    - google/cloud-firestore v1.20.0 requires google/gax ^1.1 -> satisfiable by google/
gax[1.1.0, ..., v1.9.0].
    - google/gax[1.1.0, ..., v1.9.0] require google/grpc-gcp ^0.1.0 -> satisfiable by g
oogle/grpc-gcp[0.1.0, ..., 0.1.5].
    - Root composer.json requires google/cloud-firestore ^1.20 -> satisfiable by google
/cloud-firestore[v1.20.0].

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 co
ntent.



@bshaffer
Copy link
Contributor Author

@Geolim4 thank you for your comment, but that does not have anything to do with this PR, but rather with the google/cloud-firestore library.

@Geolim4
Copy link
Member

Geolim4 commented Sep 27, 2021

@Geolim4 thank you for your comment, but that does not have anything to do with this PR, but rather with the google/cloud-firestore library.

Yes and no, this PR will still be blocked until the google/cloud-firestore is also patched to supported at least 2.0.

@bshaffer
Copy link
Contributor Author

@Geolim4 no it won't be. This library does not rely on google/cloud-firestore, so there's no way this PR would be blocked by something that takes place in google/cloud-firestore. What you mean is your issue which you logged in a separate repository would be blocked.

@Geolim4
Copy link
Member

Geolim4 commented Sep 27, 2021

The library will rely on google/cloud-firestore before the release of the V9 to support Google Firestore backend.
However this will not be a composer "requirement" but a composer "suggestion".

Like I'm actually doing for every other backend (Mongodb, Couchbase, Couchdb, etc).

However, the tests on the CI will install the full deps suggestion list to test EVERY supported backend (See Travis.yml).

So actually I'm blocked by google/cloud-firestore because two of its dependency are incompatible with psr/cache 3.0:

@Geolim4
Copy link
Member

Geolim4 commented Sep 27, 2021

Thanks for the PR @bshaffer I have to also update the .lock in another commit but its fine.

@Geolim4 Geolim4 merged commit 473b890 into PHPSocialNetwork:v9 Sep 27, 2021
@bshaffer bshaffer deleted the patch-1 branch February 23, 2022 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants