ZF-3578: Zend_Config_Xml throws warnings when loading of xml file was NOT successfull

Issue Type: Bug Created: 2008-07-04T02:53:41.000+0000 Last Updated: 2008-09-02T10:39:42.000+0000 Status: Resolved Fix version(s): - 1.6.0 (02/Sep/08)

Reporter: Patrick van Dissel (tdm) Assignee: Rob Allen (rob) Tags: - Zend_Config

Related issues: Attachments:


In the __construct() of Zend_Config_Xml, the function simplexml_load_file() is used for loading the xml file. But there is not checked if loading of the file was successfull, which causes multiple PHP warning to be thrown.

It would be nice/better to just throw an Exception when loading of the XML file was not-successfull. Something like the following would do the job:

<pre class="highlight">
$config = @simplexml_load_file($filename);
if (false === $config) {
    throw new Zend_Config_Exception('File could not be loaded');


Posted by julien PAULI (doctorrock83) on 2008-07-16T15:34:39.000+0000

fixed at r10147

Posted by Wil Sinclair (wil) on 2008-09-02T10:39:42.000+0000

Updating for the 1.6.0 release.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.