History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-1879
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Ryan Boyd
Reporter: Trevor Johns
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Check to see if DOM extension is available

Created: 26/Aug/07 03:10 AM   Updated: 27/Aug/07 02:43 PM
Component/s: Zend_Gdata
Affects Version/s: 1.0.1
Fix Version/s: None

Time Tracking:
Not Specified

Tags:
Participants: Bill Karwin, Ryan Boyd, Thomas Weidner and Trevor Johns


 Description  « Hide
If PHP was compiled with '--disable-dom', then various classes relied upon by the Zend_Gdata module will not exist and things will break. Right now, this manifests as a "Class 'DOMDocument' not found" error.

Rather than let this happen, a check should be made to see if the DOM extension is loaded, and if it isn't print a descriptive error message to help users understand the problem.



 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Bill Karwin - 26/Aug/07 11:00 AM
That's a fine idea, but for what it's worth DOM is usually enabled by default. We have used the PHP binary distribution from php.net and Zend Core as our benchmarks for what extensions are built and enabled by default. In both of those distros, DOM is enabled. In such cases, our standard in the past is not to require checks for the extension.

This is mentioned in our [draft coding standards|
http://framework.zend.com/wiki/display/ZFDEV/PHP+Coding+Standard+%28draft%29#PHPCodingStandard%28draft%29-PHPExtensions].


Trevor Johns - 27/Aug/07 02:03 PM
I had previously thought that the DOM extension was safe too.

I just helped a user over at Joyent with this issue. It turns out that they're rolling out a new setup that has many extensions installed but disabled by default for performance reasons. The list of affected extensions is posted here. It's simple enough to re-enable an extension – just modify the configuration in php.ini. However, the error message returned isn't very helpful in pointing users in that direction.

I'm not so sure going by what's in the binary distributions is the best policy, as I'm sure many hosting providers compile their own custom build.


Thomas Weidner - 27/Aug/07 02:43 PM
Assigned to Ryan