Problem/Motivation
As we learned in #3087531: Use Diactoros LTS version 1.7, not 1.8 which is out of security coverage and from the maintainers, the information documented on their Support and LTS support policy is somewhat misleading, but the 2.x major version will eventually include some LTS minor that should be supported throughout D9's lifetime.
Also in the meantime the Zend framework has been the Laminas framework.
laminas/laminas-diactoros 2.2 is currently available and requires PHP 7.1, so should be compatible with Drupal 9.0.
Proposed resolution
- Update Drupal 9 to the latest version of laminas/laminas-diactoros
laminas/laminas-diactoros 2.x brings with it a new dependency: psr/http-factory. This is the set of interfaces required for the PSR-17 HTTP Factories standard, provided and maintained by PHP-FIG and documented at https://www.php-fig.org/psr/psr-17/. It has no new dependencies; only PHP 7 and psr/http-message:^1.0, which is already a dependency of other packages we use. It is not expected to receive any updates, security or otherwise. Therefore, I think this is safe to include as a sub-dependency of Drupal core.
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
The dependency laminas/laminas-diactoros has been upgraded to version 2.2.2 which will allow us to support it through Drupal 9's lifetime.
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | 3104354-28.patch | 8.5 KB | longwave |
Comments
Comment #2
traviscarden commentedHere we go...
Comment #3
traviscarden commentedOops. This suffers from the same problem described here #3104353: Upgrade to Guzzle 7
Comment #4
longwaveFollowing the instructions in https://www.drupal.org/node/3089540, from a fresh checkout:
Resulting patch attached.
Comment #5
longwaveThis is Diactoros, not Doctrine
Comment #6
berdir> Update Doctrine to 2.1 » Update Diactoros to 2.1
Oh, this makes much more sense now, I was very confused about the multiple doctrine update issues ;)
Comment #7
traviscarden commentedThanks, @longwave. This is more like what I expected.
So the only side-effect is the addition of psr/http-factory, which is literally just interfaces and seems reasonable to me. But I'll let someone more knowledgeable in the matter RTBC this.
Comment #8
wim leersWhen we add a new dependency, we need to vet it (and all of its dependencies, if any). You can find an example in #3036210: Add justinrainbow/json-schema as a composer dependency so JSON:API can use it to validate its responses.
Comment #9
longwavepsr/http-factory is the set of interfaces required for the PSR-17 HTTP Factories standard, provided and maintained by PHP-FIG and documented at https://www.php-fig.org/psr/psr-17/. It has no dependencies other than PHP 7 and psr/http-message:^1.0 (which is already a dependency of three other packages we use). It is not expected to receive any updates, security or otherwise.
Comment #10
wim leers@longwave That's what I figured — but it's that kind of information that needs to be added to the issue summary to make it crystal clear for any community member to discover, and especially for framework managers and core committers :)
Comment #11
longwaveUpdated IS.
Comment #12
xjmGoing to get thoughts on whether we should do this first or the laminas conversions first.
In the meanwhile, here's the core dependency page: https://www.drupal.org/core/dependencies
We'll want to add
psr/http-factorythere. It looks like we're also missing the other PSR interface from the page so we can add both.Comment #13
traviscarden commentedI added
psr/http-factoryandpsr/http-messagesto the core dependency page, but I couldn't find any publicly posted details on release cycles and security policies. So I left those cells blank and asked about them on the PHP-FIG mailing list. I'll add the missing details as soon as they're provided.Comment #14
traviscarden commentedI received the following response and updated the core dependency page:
Comment #15
xjmThanks @TravisCarden! I'll work on documenting that further on the page.
Discussed with @catch whether we should complete this or #3104015: Replace ZendFramework/* dependencies with their Laminas equivalents first, since they will conflict. @catch suggested doing the other first since that way the backport is more straightforward for that issue. So postponing on #3104015: Replace ZendFramework/* dependencies with their Laminas equivalents.
Comment #16
traviscarden commented#3104015: Replace ZendFramework/* dependencies with their Laminas equivalents, which looks like it will remove Diactoros altogether, should render this issue obsolete.
@xjm, I'll add more detail to the dependencies page.
Comment #17
xjmHm? 🤔 I don't think it does. Drupal fails hard without Diactoros; the whole HTTP request system or something depends on it as our PSR-7 implementation. It's removed as a dev dependency of one package but Drupal itself still depends on it. We explored replacing it prior to the 8.8 beta deadline and decided we needed to keep it.
Comment #18
traviscarden commentedOh, I was imprecise. I meant that
zendframework/zend-diactorosis removed, being replaced bylaminas/zend-diactoros. But you're right, @xjm: the version won't be updated in the other issue, so we'll still need to do this.Comment #19
traviscarden commentedRe: #15, I expanded the Core dependency documentation page to include the details from #14.
Comment #20
alexpottThe laminas issue has landed - we can now upgrade the laminas components here.
Comment #21
longwaveComment #22
longwaveWe actually get 2.2 here!
Comment #23
alexpottAs there are no code changes here can we update all the laminas components here? Doing updates one component at a time feels very piecemeal.
Comment #24
longwaveThe Zend bridge can go up by a point release, but the rest are already at their latest versions (double checked at GitHub that there are no new major versions)
Comment #25
alexpott@longwave yep I've just looked at composer show -i and https://framework.zend.com/long-term-support (still the easiest place to see the latest version numbers) and you're right. Nice one.
I've updated the issue summary to be more specific about which diactoros is being updated.
Comment #26
alexpottComment #27
catchNeeds a re-roll (probably due to the PHP 7.3 patch).
Comment #28
longwaveComment #29
catchBack to RTBC (but waiting for the bot to come back green).
Comment #30
xjmIs this removal supposed to be in the patch? I have a feeling of déja vu about it.
Comment #31
xjmDisregard #30; it's actually just a part of the
http-messageupdate and I just misread the indentation.Comment #33
xjmI applied the patch locally, and verified it was copacetic for all the various things with an extra
composer installandcomposer update --lock. No diff from the patch.Committed and pushed to 9.0.x. Thanks! Tagging for the release notes.
Comment #34
alexpott@xjm #30 is correct - this has been seen before - that part of the diff is part of the composer/composer info in the lock file. We're removing the bin directory from composer in
\Drupal\Composer\Plugin\VendorHardening\Config::$defaultConfigso there's nothing to link so vendor/bin doesn't contain composer. So I think it is fine to remove it - it's meaningless and if it comes back it doesn't really matter either. I've tried regenerating the patch and this is always getting removing using the latest stable version of composer. So I'd leave this removal in - it's not going to cause problems.