Re: PEAR::Config - reading XML files

From: Date: Thu, 03 Jul 2003 13:32:53 +0000
Subject: Re: PEAR::Config - reading XML files
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-6435@lists.php.net to get a copy of this message
Hi Betrand, Bertrand Mansion wrote:
but how do I parse more XML files in different sections? Can someone point me in the right direction please?
Hi Jeroen, At the moment, there is no easy way to do that, particularly because PHP4 doesn't accept default values for arguments passed by reference :( But I think PHP5 will. Okay, but in the meantime I can use this I think.
$config = new Config(); $conf =& $config->parseConfig('views.xml', 'xml'); $conf =& $config->parseConfig('models.xml', 'xml'); But now how do I find entries inside say $conf? Say I would like to retrieve all the views, or find values inside views. here's my XML file: <views> <view name="insertable">
       <model>contact</model>
       <classfile>views/Person_Insertable.class.php</classfile>
</view> <view name="editable">
       <model>contact</model>
       <classfile>views/Person_Editable.class.php</classfile>
</view> <view name="frozen">
       <model>contact</model>
       <classfile>views/Person_Frozen.class.php</classfile>
</view> </views> TIA Jeroen

« previous php.pear.general (#6435) next »