Skip to content

Add missing ext/libxml dependency to ext/xmlwriter #14327

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 1 commit into from
May 26, 2024

Conversation

petk
Copy link
Member

@petk petk commented May 25, 2024

This adds the libxml extension to required dependencies for xmlwriter during the configuration phase (PHP_ADD_EXTENSION_DEP) and the runtime (ZEND_MOD_REQUIRED).

I'm not sure if there is some internal limitation on adding these ZEND_MOD_* dependencies. Would this cause any performance overhead? These are also used so that extensions are sorted properly when being registered into the Zend hash table.

This adds the libxml extension to required dependencies for xmlwriter
during the configuration phase (PHP_ADD_EXTENSION_DEP) and the runtime
(ZEND_MOD_REQUIRED).
Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

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

Interesting...
Technically, ext-libxml isn't required for this extension to work in a "minimal way"; but it is necessary to make it work properly (i.e. have proper error reporting etc).

The same problem may exist for ext-xmlreader.

I'm not sure if there is some internal limitation on adding these ZEND_MOD_* dependencies. Would this cause any performance overhead? These are also used so that extensions are sorted properly when being registered into the Zend hash table.

Doubt this will cause much overhead at all; it's only checked on startup anyway.

@petk
Copy link
Member Author

petk commented May 26, 2024

I see, thanks for the info. The xmlwriter works without libxml extension but in a limited way. 🤔 I'll add this info in the commit message.

@nielsdos
Copy link
Member

The xmlwriter works without libxml extension but in a limited way.

I'll clarify a bit. It's an extension that uses libxml to do its work. We have a support layer in PHP for all extensions that use libxml, it's the "libxml" extension, i.e. the code in ext/libxml. While some extension (like xmlwriter) can work without that support layer, it would not be able to use proper error reporting or have support for streams without it.

@petk petk merged commit 8be3426 into php:master May 26, 2024
10 checks passed
@petk
Copy link
Member Author

petk commented May 26, 2024

I've merged it now in the master branch. I hope I wasn't too quick. We can refactor this in the near future if needed.

@nielsdos
Copy link
Member

I've merged it now in the master branch. I hope I wasn't too quick. We can refactor this in the near future if needed.

No, your PR is fine.

@petk petk deleted the patch-xmlwriter branch May 26, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants