How to include configuration data

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
How do you import for example your database username, hostname etc.  With a
PHP named config.php file saying:
$conf['db']['username'] = ...
This is the way it is usualy done.  But could you do it with XML (afraid of
the performance hit) or with a ini file;
My main concerns are: security, performance and ease of use.

What have you tried and found usefull?

Rutger Claes                                                rgc@rgc.tld
Replace tld with top level domain of belgium to contact me    pgp:0x3B7D6BD6
Send some filthy mail.

Re: How to include configuration data

*** Rutger Claes wrote/escribió (Fri, 19 Nov 2004 10:19:39 +0100):
Quoted text here. Click to load it

If you use an *.ini file you already have a core function to handle it:

Usage: array parse_ini_file ( string filename [, bool process_sections] )
Purpose: Parse a configuration file
Availability: PHP 4  

I don't know much about XML.

-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions

Site Timeline