[fw-general] [ZF-General] Reading from XML file using ConfigXML

2007-07-19 Thread AmirBehzad Eslami
Hi, Suppose we have an XML file like the following one: localhost 3306 root TRUE Note that the 'database' has a 'type' attribute. How can I read the type attribute of database? $config = new Zend_Config_

[fw-general] [ZF-General] Reading from XML file using ConfigXML (OOPS)

2007-07-19 Thread AmirBehzad Eslami
Sorry, the code should be like this: $config = new Zend_Config_Xml('./application/config.xml', 'production', FALSE); echo($config->database->type->value); echo($config->database->type); These still return NULL.

Re: [fw-general] [ZF-General] Reading from XML file using ConfigXML

2007-07-19 Thread Simon Mundy
Zend_Config ignores any element attributes. You'd be better off adding mysqli and then passing it across like:- $db = Zend_Db::factory($config->database->type, $config->database- >toArray()); Hi, Suppose we have an XML file like the following one: lo

Re: [fw-general] [ZF-General] Reading from XML file using ConfigXML

2007-07-19 Thread AmirBehzad Eslami
Thanks a lot Simon! I'm afraid to hear that Zend_Config ignores any element attribute. Perhaps this is because of its SimpleXML origin. I'm not certain on this. Anyway, I come up with: Config.xml ~~ mysqli localhost

RE: [fw-general] [ZF-General] Reading from XML file using ConfigXML

2007-07-19 Thread Bill Karwin
eral] [ZF-General] Reading from XML file using ConfigXML Hi, Suppose we have an XML file like the following one: localhost 3306

Re: [fw-general] [ZF-General] Reading from XML file using ConfigXML

2007-07-19 Thread AmirBehzad Eslami
::factory($config->database->type, $config->database->params); Regards, Bill Karwin -- *From:* AmirBehzad Eslami [mailto:[EMAIL PROTECTED] *Sent:* Thursday, July 19, 2007 5:50 PM *To:* fw-general@lists.zend.com *Subject:* [fw-general] [ZF-General] Reading f

Re: [fw-general] [ZF-General] Reading from XML file using ConfigXML

2007-07-19 Thread Simon Mundy
I'm not 100% sure but I'm taking a good guess that it's the best way to ensure functionality for the config files remains reasonable similar. You can't, for example, specify attributes for Zend_Config_Array nor Zend_Config_Ini without significantly altering the way that they're structured.

RE: [fw-general] [ZF-General] Reading from XML file using ConfigXML

2007-07-19 Thread Bill Karwin
egards, Bill Karwin From: AmirBehzad Eslami [mailto:[EMAIL PROTECTED] Sent: Thursday, July 19, 2007 6:33 PM To: Bill Karwin Cc: fw-general@lists.zend.com Subject: Re: [fw-general] [ZF-General] Reading from XML file using ConfigXML

Re: [fw-general] [ZF-General] Reading from XML file using ConfigXML

2007-07-19 Thread Simon Mundy
o:[EMAIL PROTECTED] Sent: Thursday, July 19, 2007 6:33 PM To: Bill Karwin Cc: fw-general@lists.zend.com Subject: Re: [fw-general] [ZF-General] Reading from XML file using ConfigXML Bill Karwin wrote: $db = Zend_Db::factory($config->database->type, $config->database- >params); I