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
Sunsetting doctrine/cache #354
Comments
Maybe this is the wrong place to ask, but will dbal/orm be switching cache implementations? |
Yes. We are in the process of preparing DBAL, ORM, and all other internal users of doctrine/cache to no longer depend on the cache implementations. We will retain backward compatibility to the interfaces, but those methods will be deprecated and will not be part of the next major release. |
Is the plan to make the uses of doctrine/cache be also compatible with a psr implementation? Or will we have to use something like the new PSR6 adapter? |
the PSR-6 adapter is part of the migration layer: when a library depends on the doctrine/cache interface for its caching layer, you can use the PSR-6 adapter to wrap your PSR-6 caching library, to provide it to the place needing doctrine/common. In the longer term, the idea is that libraries that depend on doctrine/cache today should migrate to consume PSR-6 directly (that's the work that is in progress for DBAL, ORM and other Doctrine projects). |
Thanks! That makes it clear to me |
After working on removing doctrine/cache from various doctrine libraries, here is an updated timeline. We will introduce two new classes in doctrine/cache 1.11:
doctrine/cache 1.11 will not mark existing cache implementations as deprecated. This is done to allow the ecosystem to start migrating away from doctrine/cache before we trigger multiple deprecation notices. These deprecations will be done in 1.12, which will be released once the various doctrine libraries no longer directly rely on doctrine/cache implementations but support PSR-6. doctrine/cache 2.0 will drop all cache implementations, but will retain the two compatibility classes in the For any software that allows configuring doctrine/cache, we recommend to bump the doctrine/cache dependency to If your software uses doctrine/cache implementations (e.g. |
…ool (mbabker) This PR was merged into the 3.x-dev branch. Discussion ---------- Add an AclCache implementation supporting a PSR-6 cache pool With [`doctrine/cache` being sunsetted](doctrine/cache#354), the component should provide a cache implementation that doesn't rely on an effectively deprecated package. This PR adds a cache implementation supporting any PSR-6 cache pool which can be used as a replacement. Closes #76 Commits ------- d48f5e5 Add an AclCache implementation supporting a PSR-6 cache pool
Packages which use it now allow v2 for compatibility with new PSR-6 cache libraries, and v2 doesn't have the adapters we currently need. "Please note that doctrine/cache is deprecated and no longer maintained. The last version to include cache drivers is 1.11." https://www.doctrine-project.org/projects/doctrine-cache/en/2.0/index.html doctrine/cache#354
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This happened in one of our projects as well, but that was because we used code from this dependency without having it as an explicit dependency ourselves. If you rely on code of a package it should be an explicit dependency. You could use a tool like https://github.com/maglnet/ComposerRequireChecker to find where you are using code that you aren't explicitly requiring. |
The alternative is to use PSR-6 (or PSR-16 if you prefer), for which packagist has several maintained packages implementing it. That's precisely why doctrine/cache is being sunset, as Doctrine decided to migrate to using PSR-6 instead of maintaining its own cache library. |
@GregOriol consider @BackEndTea 's approach to life: there is a good to fair chance that, like him, you or the components you are using were missing an explicit dependency : There was no need to antagonize us like that, and I think an apology would be in order. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
You know @GregOriol, if you had only been less of a prick I would've loved to help you out. Do you seriously think I've never been in your situation? Do you think that in more than a decade of full-time work as an engineer I've never faced a situation like that? So when you see an issue like this, why would you even think that I just got up one morning and decided to "break things that worked well"? Instead, if you had checked the timeline, you'd have realised that this issue was created in December 2020, and that we released 1.11 announcing the deprecation on April 22, 2021. Besides that, as you can see from the plan laid out in the OP, there's a lot of thinking that went into this. In fact, the first work for this was done at SymfonyCon 2019 in Amsterdam. Countless people have dedicated their personal time for this to ensure a smooth transition. You only need to check if you're instantiating any cache implementations. As for alternatives, we decided to only suggest any PSR-6 implementation, since that's what your framework of choice will provide. I'd consider it unfair to suggest a particular implementation, since you may not necessarily have a choice: you may already be using a PSR-6 adapter of choice, your framework may provide you with a cache component that integrates with PSR-6, or you may have created your own thing. Either way, that's why we have standards: so that people can choose the best tool for the job. Speaking of the best tool, let's look at doctrine/cache 1.x. It is used by millions and millions of projects. If we look at Packagist install statistics, you can see that the package is getting close to ~200k installs per day. Yet, over the past few years, only a few people (less than 20) have contributed to the package in any way. Adapters started becoming useless, the code was not being updated, nobody investigated bugs. In the wider scheme of things at Doctrine, this project was becoming a nuisance. It was built in 2008 because at the time, there was no cache library. It was very specific to what Doctrine ORM needed, but since it was always there when you used Doctrine, people started using it for everything. Now, we no longer have the time or energy to maintain this. The code has aged, and just like not every wine will age well, not every code will. There are obscure cache implementations in there that probably nobody uses, and we're probably missing a number of features. However, they are not relevant for Doctrine: we don't want to figure out how to efficiently cache stuff; we have the need to cache something, and if other tools can do it better, we use those. So after a lot of discussions that took a serious toll on my mental health, I made a push to drop doctrine/cache from our own tools. People can still use it: And all of that process, over 1.5 years, countless hours of thinking, countless attempts to not break every single As a reminder to everyone reading this issue: OPEN SOURCE MAINTAINERS DON'T WORK FOR YOU! They are people with jobs that share a passion. If you want to contribute to this community in a meaningful way. If you can't do that, you're free to play in your corner and leave us alone. I'm locking this discussion, because I have no desire to condone this kind of behaviour by allowing people like that to keep tooting into the same horn repeatedly. Nothing to see here, move along. |
Hello,
with many great PSR-6 and PSR-16 implementations available, it is no longer feasible for the Doctrine Project to keep maintaining a separate cache library. We have thus decided to sunset doctrine/cache and prepare its removal process. As many libraries, including our own, depend on this package, this process will be gradual.
Version 1.11 will deprecate all classes and interfaces provided, but the library will continue working as expected. We will provide the same level of support as we have so far. We will also release version 2.0, which will drop all cache implementations and only retain the abstract
CacheProvider
class as well as the interfaces. 2.0 is designed as a lightweight package that compatibility libraries (e.g. symfony/cache which provides a bridge to PSR interfaces) can depend on.If your package currently depends on any doctrine/cache version, here's what you should do:
"doctrine/cache": "^1.10 || ^2.0"
If you would like to take over maintenance of the package, please reach out to us.
The text was updated successfully, but these errors were encountered: