Skip to content

migrated to laminas/laminas-diactoros (#125) #134

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 3 commits into from
Dec 3, 2020

Conversation

driehle
Copy link
Contributor

@driehle driehle commented Oct 12, 2020

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Related tickets #125
License MIT

What's in this PR?

This PR replaces zend/zend-diactoros with laminas/laminas-diactoros. Due to laminas/laminas-zendframework-bridge, there is no BC break.

Why?

Because zend/zend-diactoros is officially abandoned.

@driehle driehle force-pushed the feature/laminas-diactoros branch from 3868121 to 378765c Compare October 12, 2020 11:05
@driehle driehle force-pushed the feature/laminas-diactoros branch from 378765c to 868ed49 Compare October 12, 2020 11:24
@dbu
Copy link
Contributor

dbu commented Oct 13, 2020

if i understand correctly, this means that if one installs only laminas, but not the zend-bridge, the factory now returns a different class. i would hope that users do not rely on the concrete implementations when using this factory (otherwise there is no need to use the factory anyways). so to me this seems fine.

i suggest we do a new minor version, as it still is more than a bugfix. can you please rebase on the master branch and add something to the changelog (including mentioning the bridge?)

@driehle
Copy link
Contributor Author

driehle commented Oct 13, 2020

if i understand correctly, this means that if one installs only laminas, but not the zend-bridge, the factory now returns a different class. i would hope that users do not rely on the concrete implementations when using this factory (otherwise there is no need to use the factory anyways). so to me this seems fine.

Yes, you need to have the bridge installed. However, the bridge is required as a dependency of laminas-diactoros (see https://packagist.org/packages/laminas/laminas-diactoros) and will, to my understanding, be included there as a dependency until laminas-diactoros releases a major update (i.e. 3.0). So as soon as someone will have laminas-diactoros 2.x installed, they will have the bridge installed as well.

In the autoloader of the bridge you can see that they use class_alias() to create the legacy classes (e.g. ZendRequest). Therefore, if you have laminas-diactoros and the bridge installed, you will actually use LaminasRequest, but an $laminasRequest instanceof ZendRequest will still hold true (and vice versa, tough that is unlikely to happen).

i suggest we do a new minor version, as it still is more than a bugfix. can you please rebase on the master branch and add something to the changelog (including mentioning the bridge?)

Sure, will do.

@driehle driehle force-pushed the feature/laminas-diactoros branch from 3b40bfd to bcffd52 Compare October 13, 2020 08:39
@driehle
Copy link
Contributor Author

driehle commented Oct 13, 2020

Rebased and changelog updated. I fixed some broken and missing links in the changelog as well. ;-)

puli.json Outdated
@@ -7,7 +7,7 @@
"class": "Http\\Message\\MessageFactory\\DiactorosMessageFactory",
"type": "Http\\Message\\MessageFactory",
"parameters": {
"depends": "Zend\\Diactoros\\Request"
"depends": "Laminas\\Diactoros\\Request"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure how many people use puli, but i think we should only add the laminas things but not replace zend.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not using puli and also not sure about its usefullness in general, but the way in understand this would be that adding two dependencies would mean that both (AND) are required and not only one (OR). If this is the case, then we should leave it with laminas here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nyholm do you know if we can make puli detect both the old and the new class?

if we can't i opt to configure it with the old class. when the BC layer is there, that should even still work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nyholm wdyt?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im honestly not sure either.. :/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then we should probably stick to the old class name...

@dbu
Copy link
Contributor

dbu commented Oct 26, 2020

can you please fix the cs issue? https://github.com/php-http/message/pull/134/checks?check_run_id=1246548559

if tobias can clarify the puli usage, we can adjust that, if not i suggest we revert the puli change to not introduce unexpected BC breaks.

@driehle driehle force-pushed the feature/laminas-diactoros branch from bcffd52 to 2d02b25 Compare December 2, 2020 17:15
@driehle
Copy link
Contributor Author

driehle commented Dec 2, 2020

can you please fix the cs issue? https://github.com/php-http/message/pull/134/checks?check_run_id=1246548559

if tobias can clarify the puli usage, we can adjust that, if not i suggest we revert the puli change to not introduce unexpected BC breaks.

@dbu: Rebased on current master, fixed CS issue. Still awaiting the reply of @Nyholm regarding puli.

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@dbu dbu merged commit 6e2c574 into php-http:master Dec 3, 2020
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.

3 participants