-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] Use DOM instead of SimpleXML for namespace support #9350
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
Conversation
Duplicated #6147 |
This allows tagging a service with an 'doctrine.orm.entity_listener' tag. These tagged services will automatically be registered with the entity listener resolver. Note: The changes to the XML fixture cannot be parsed due to a bug in the Symfony DependencyInjection component. A PR that fixes this issue can be found at symfony/symfony#9350. When that PR has been merged, all tests in this commit pass.
Any updates on whether this issue or issue #6147 will be merged? |
* | ||
* @throws InvalidArgumentException When loading of XML file returns error | ||
*/ | ||
protected function parseFileToDOM($file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should be private.
@sandermarechal Can you rebase on current master? To answer your questions:
|
Closing in favor of #10619 |
… namespace support (sandermarechal, romainneutron) This PR was merged into the 2.5-dev branch. Discussion ---------- [DependencyInjection] Use DOM instead of SimpleXML for namespace support | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #9345 | License | MIT This PR replaces #9350 Commits ------- a3c60c8 [DependencyInjection] Deprecate SimpleXMLElement 33c91f9 [DependencyInjection] Use DOM instead of SimpleXML for namespace support
This allows tagging a service with an 'doctrine.orm.entity_listener' tag. These tagged services will automatically be registered with the entity listener resolver. Note: The changes to the XML fixture cannot be parsed due to a bug in the Symfony DependencyInjection component. A PR that fixes this issue can be found at symfony/symfony#9350. When that PR has been merged, all tests in this commit pass.
This PR makes the XmlFileLoader use the DOM instead of SimpleXML. This allows full namespace support in XML files. Previously, the Symfony container namespace had to be the default namespace for the document. See also #9345.
Some things to discuss:
I avoided any BC breaks but I do not know if the things I avoided breaking are actually part of the API. There are two places this applies to:
Symfony\Component\DependencyInjection\SimpleXMLElement
still exists, but it is no longer used, except to maintain BC. It does not appear to be used anywhere else in Symfony itself. Maybe some userland code uses it somewhere. If this is not part of the API it could be removed.parseFile
method still returns a SimpleXMLElement to maintain BC. I have added a new functionparseFileToDOM
that is used by the XmlFileLoader itself. If this is not part of the API we could drop that new function and haveparseFile
return a\DOMDocument
instead.