RE: use of ini vs include file for configuration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Tamara Temple [mailto:tamouse.lists@xxxxxxxxx] 
> Sent: Thursday, November 11, 2010 11:04 AM
> To: PHP General
> Subject:  use of ini vs include file for configuration
> 
> I'm curious what the lists' opinions are regarding the use of 
> an .ini  
> file versus an include configuration file in PHP code are?
> 
> I can see uses for either (or both).
> 
> To me, it seems that an .ini file would be ideal in the case 
> where you  
> want to allow a simpler interface for people installing your app to  
> configure things that need configuring, and an included PHP code  
> configuration file for things you don't necessarily want the average  
> installer to change.
> 
> What do you think?
> 
> Tamara

We used config.inc.php for the past few years, but as our project is grown
and we have several other departments developing portions in several
different languages (not JUST PHP) but all wanting to share resources such
as database connection information, pathing, email addresses (for error
reporting, notifications, etc.), memcache servers, etc. using a PHP file is
not an option. It can be a shim however and that's what I've done over the
past few days is to parse the .ini and populate the same config.inc.php
file with said values so that all the code continues to work. Plus it
allows for easy populating in a programatic way if you name your variables
right and organize things.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux