Skip to content
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

Remove support for GD images in Stream implementation #148

Merged
merged 4 commits into from
May 2, 2023

Conversation

weierophinney
Copy link
Member

Q A
Documentation no
Bugfix yes
BC Break yes
New Feature no
RFC no
QA no

Description

GdImage-backed Stream instances have evidently never worked, but feature removal needs to happen in a new major.

See #57, #134, and #147 for full details behind removal.

These have evidently never worked, but feature removal needs to happen in a new major.

Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
@weierophinney weierophinney added this to the 3.0.0 milestone May 2, 2023
@weierophinney weierophinney added BC Break Bug Something isn't working labels May 2, 2023
Prepares the v3 documentation tree, and modifies the following:

- The migration guide is now for v3, and covers the GdImage changes in this patch.
- The "API" page removes references to usage of GdImage with `Stream`.
- The TOC is updated to add version 3.

Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
Copy link
Member

@boesing boesing left a comment

Choose a reason for hiding this comment

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

Should we re-introduce the stream compat check in StreamFactory as it was removed in https://github.com/laminas/laminas-diactoros/pull/45/files#diff-565876e19198a94175bb659207c750dcb80cbbfa104490c6fad5322dd05d5febL49-L53 or do we verify that by waiting for the check in __construct => setStream of Stream#__construct?

@weierophinney
Copy link
Member Author

Should we re-introduce the stream compat check in StreamFactory as it was removed in https://github.com/laminas/laminas-diactoros/pull/45/files#diff-565876e19198a94175bb659207c750dcb80cbbfa104490c6fad5322dd05d5febL49-L53 or do we verify that by waiting for the check in __construct => setStream of Stream#__construct?

It's stil there, just done in a different way. In isValidStreamResourceType, we check to see if (a) we have a resource, and (b) if it's in the list defined by the class constant ALLOWED_STREAM_RESOURCE_TYPES... which now only defines stream as a valid resource type.

Keeping it this way allows us to more easily expand it in the future, and keeps the same check that we had prior to adding GD support anyways.

@boesing
Copy link
Member

boesing commented May 2, 2023

It's stil there, just done in a different way.

StreamFactory validates valid resource type by counting on Stream#__construct to validate resource.
So yes, it is there, but its more implicit than explicit.

That was what I wanted to clarify. If we are happy with implicit validation, thats okay for me as well.

@Xerkus
Copy link
Member

Xerkus commented May 2, 2023

I would like mentions of GD removed from documentation in v2 folder too so it won't be on live site anymore when this is released since it never worked.

If it didn't work, don't mention it.

Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
@weierophinney
Copy link
Member Author

I would like mentions of GD removed from documentation in v2 folder too so it won't be on live site anymore when this is released since it never worked.

Done.

docs/book/v2/api.md Outdated Show resolved Hide resolved
Co-authored-by: Aleksei Khudiakov <aleksey@xerkus.pro>
Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
@Xerkus Xerkus merged commit 6fce157 into laminas:3.0.x May 2, 2023
@Xerkus
Copy link
Member

Xerkus commented May 2, 2023

Thank you!

@weierophinney weierophinney deleted the feature/image-stream-removal branch May 2, 2023 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC Break Bug Something isn't working Documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove image stream compatibility from Stream Stream is not fully compatible with GD resource
3 participants