Enable SWC files support and building with zlib extension#20867
Enable SWC files support and building with zlib extension#20867petk wants to merge 1 commit intophp:masterfrom
Conversation
This optionally checks whether zlib is installed on the system, regardless of PHP extension zlib being built as static, shared or disabled. The zlib library is needed to be linked for having SWC files support in PHP. Previously, only SWC support was possible only if PHP was built with static zlib PHP extension. As SWC files are obsolete, no additional configuration option is provided and check is done as optional to have as little backward incopatibilities in builds. Fixes: phpGH-4681
|
Is the SWC files the only place which require zlib? |
Yes. |
|
thank you, gonna try build it this weekend |
|
I don't particularly like linking the core binary with zlib. I think the comment - that I put - points to the right solution. It shouldn't be hard to do this I think. It would be a tiny BC break as the constant value of IMAGETYPE_SWC changes and you'd get an undefined constant error instead of a warning... |
|
@ndossche yes, agreed totally. I can't say that I would know how to change the code to the Another option would be here to treat ext/zlib as "required" extension. Similar to |
|
I like the idea "to treat ext/zlib as "required" extension" as it was really hard to understand why I can't build it as shared |
|
ext/libxml is not a required extension, it is a default extension however |
This optionally checks whether zlib is installed on the system, regardless of PHP extension zlib being built as static, shared or disabled. The zlib library is needed to be linked for having SWC files support in PHP.
Previously, only SWC support was possible only if PHP was built with static zlib PHP extension.
As SWC files are obsolete, no additional configuration option is provided and check is done as optional to have as little backward incopatibilities in builds.
Fixes: GH-4681
What do you think?
cc @andypost @glensc
Earlier bug report was also at: https://bugs.php.net/bug.php?id=34338
Edit: I've opened also an issue about this as it's unclear how to best resolve this issue #20868 It's problematic as it's hidden and undocumented that for SWC files zlib extension needs to be built as static. And there is also a new API that perhaps would resolve this better - commented in image.c as
TODO: with the new php_image_register_handler() APIs, this restriction could be solved.