Re: PEAR::Config Question

From: Date: Sat, 09 Apr 2005 20:47:32 +0000
Subject: Re: PEAR::Config Question
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-18657@lists.php.net to get a copy of this message
On Apr 8, 2005, at 7:31 PM, Ammar Ibrahim wrote:
I'm writing a MSSQL to MySQL Migration Utility, I'm using *Config* to manage the configuration, I want it to read from an XML file. The sturcutre is provided below. Now I want to be able to loop over 'databases' & 'tables'. What's the best way to do this, I'd rather stay away from arrays, is there a DOM access like way to get the objects. And is there a better way to structure my XML?
You can access config containers in a dom-like fashion. This article at devshed: http://www.devshed.com/c/a/PHP/Configuration-Manipulation-With-PHP-Config/5/ would probably be a great place to start. Of course, let me know if you have any more questions. -ryan
<config> <rdbms>
       <source type="mssql">
           <host></host>
           <user></user>
           <pass></pass>
       </source>              <destination type="mssql">
           ....
       </destination>        </rdbms>
<databases>
       <database newname="legs_jo">JOLEGSZEFT</database>
</databases>
     <tables>
       <table newname="foo">
           <name>bar</name>
           <columns>
               <col newname="new_col_name" callback="intToDate>start_date</col>
           </columns>
       </table>     </tables>
</config> --PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- http://theryanking.com/

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