ZF-2162: Zend_Config_Xml usage without sections bug

Issue Type: Bug Created: 2007-11-06T22:39:44.000+0000 Last Updated: 2007-12-15T21:46:38.000+0000 Status: Resolved Fix version(s): - 1.0.3 (30/Nov/07)

Reporter: Geoffrey Tran (potatobob) Assignee: Rob Allen (rob) Tags: - Zend_Config

Related issues: Attachments: - application.xml


It appears the Zend_Config_Xml class does not differ from a SimpleXMLElement that contains children vs on that does not (eg a string) when not using sections.

For instance:

<pre class="highlight">
$config = new Zend_Config_Xml('ourFile.xml', null);

This would load everything under the root element without the use of sections, but because of this bug, it will set any 1st level element within the root element that is a string to an empty Zend_Config object instead of a string which is expected.

<pre class="highlight">

The following would be accessed like this:

<pre class="highlight">
echo $config->home; // Errors out because it contains an empty Zend_Config obj;

Attached is the patch


Posted by Darby Felton (darby) on 2007-11-09T14:01:40.000+0000

Assigning to [~rob] to initiate issue review.

Posted by Rob Allen (rob) on 2007-11-15T10:30:24.000+0000

Hi Geoffrey,

Can you provide an example config.xml please ?



Posted by Geoffrey Tran (potatobob) on 2007-11-16T17:42:27.000+0000

ok attaching the file...

The bug would happen on access to home and throw_exceptions since they are 1st level elements

Posted by Rob Allen (rob) on 2007-11-23T16:32:25.000+0000

Resolved in svn 6906 and svn 6907

Have you found an issue?

See the Overview section for more details.


© 2006-2021 by Zend by Perforce. Made with by awesome contributors.

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