Re: PEAR::Config Question
| From: | Ryan King | Date: | Sun, 10 Apr 2005 05:26:46 +0000 |
| Subject: | Re: PEAR::Config Question | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-18663@lists.php.net to get a copy of this message | ||
On Apr 9, 2005, at 9:17 PM, Dan Rossi wrote:
Wow I am using Config in PHP5, yeh maybe I should convert ti simplexml :) , is there any chance of config using simplexml if its going to be quicker ?That's the plan. Of course, that'll probably have to wait for Config2, which may be substantially different from Config1. :-) -ryan
On 10/04/2005, at 7:09 AM, Paul Holt wrote:-- http://theryanking.com/No! No! Changed my mind... use SimpleXML instead! http://www.php.net/simplexml <? $config = simplexml_load_file("config.xml"); echo $config->rdbms->source['type']; ?> Outputs "mssql" ! On Apr 9, 2005 9:54 PM, Paul Holt <pcholt@gmail.com> wrote:-- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpI'd use http://www.php.net/domxml in PHP4 or http://www.php.net/dom in PHP5. They're excellent for files where the file size is limited so you won't mind reading the entire file into a data structure in memory. On Apr 9, 2005 3:31 AM, Ammar Ibrahim <ammar@gnuix.com> wrote:-- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpI'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? <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