Issues

ZF-7772: iterating over a Zend_Config

Issue Type: Bug Created: 2009-09-04T05:11:09.000+0000 Last Updated: 2009-11-19T12:33:41.000+0000 Status: Resolved Fix version(s): Reporter: Patrick van Dissel (tdm) Assignee: Rob Allen (rob) Tags: - Zend_Config

Related issues: - ZF2-10

Attachments:

Description

There are two xml-files.

<pre class="highlight">
<?xml version="1.0" encoding="utf-8" ?>

and

<pre class="highlight">
<?xml version="1.0" encoding="utf-8" ?>

and the sample code:

<pre class="highlight">
<?php
    require_once 'Zend/Config.php';
    require_once 'Zend/Config/Xml.php';
    
    $config = new Zend_config_xml('/path/to/config.xml');
    foreach ($config->files->file as $value)
        echo 'id: '.$value->id.'<br></br>location: '.
            htmlspecialchars($value->location).'';
?>

If the /path/to/config.xml to substitute config1.xml, then everything works correctly. But if you substitute config2.xml error

<pre class="highlight">
Notice: Trying to get property of non-object in D:\www\index.php on line 7

How can I iterate all items file, if their number is not known in advance (one or more than one)?

Comments

Posted by Patrick van Dissel (tdm) on 2009-09-04T05:13:14.000+0000

This issue is related to ZF-6109, but I create this clone issue because the original is set only for ZF version 1.7.7, but ZF version 1.9.2 still has the issue

Posted by Patrick van Dissel (tdm) on 2009-09-04T05:16:31.000+0000

See related issue for more comments on this issue

Posted by Rob Allen (rob) on 2009-09-04T09:28:41.000+0000

{quote} How can I iterate all items file, if their number is not known in advance (one or more than one)? {quote}

The more important question is how do we solve this without breaking backwards compatibility?

Posted by Rob Allen (rob) on 2009-11-19T12:33:41.000+0000

Duplicate of ZF-6109

Have you found an issue?

See the Overview section for more details.

Copyright

© 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.

Contacts