Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Let JFactory::getXML() opt to receive a SimpleXMLElement. #1222

Closed
wants to merge 1 commit into from

Conversation

realityking
Copy link
Contributor

This adds a deprecated log message to the constructor of JXMLElement and to reduce the number of times this is actually output prevents loading it all the time. I'm not sure whether we shouldn't default to load SimpleXMLElement instead of JXMLElement. For now I opted for the safer option but I'd like to hear what others think.

@ianmacl
Copy link
Contributor

ianmacl commented May 26, 2012

Is there really a need for this method these days? If somebody wants a SimpleXmlElement they should probably call simplexml_load_file or simplexml_load_string.

@realityking
Copy link
Contributor Author

I thought about that too. The only advantage I can see is that the error handling is mostly done for you - the rest is just fluff. What do others think?

@LouisLandry
Copy link
Contributor

Ya, I tend to be with @ianmacl on that. The XML based stuff in Joomla was written in a time when 4.3 was the minimum requirement and we didn't have really good XML parsing in PHP natively. That really isn't the case anymore, and I would lean towards deprecating all of it for removal.

@piotr-cz
Copy link
Contributor

I decided not to use JFactory::getXML() in project because I need to catch exeptions on creating the object and ignore one of libxml parsing errors.

@realityking
Copy link
Contributor Author

Superseded by #1239.

@realityking realityking closed this Jun 3, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants