Zend_Config_Xml strange behaviour

前端 未结 1 1204
无人共我
无人共我 2021-01-23 05:37

I have a strange problem with Zend_Config_Xml.

Here is an example.

With this xml file https://gist.github.com/883465

this code:

$confi         


        
相关标签:
1条回答
  • 2021-01-23 06:01

    It seems that Zend_Config_Xml explicitly collapses such 1-element collections (there's an if statement in the source that does this). Some possible workarounds:

    • Overload Zend_Config_Xml and fix the loader code so it doesn't collapse 1-element collections
    • Overload Zend_Config_Xml and overload get() to include your ugly workaround in a cleaner way.
    • Use SimpleXML instead of Zend_Config_Xml
    0 讨论(0)
提交回复
热议问题