Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

best php config / ini class?

I'm looking for an alternave to the parse_ini_file() function in php. I want a simple way to store config settings, but want the flexibility to store unlimited levels of multiple arrays, special characters, etc. Any ideas?

like image 982
Bala Clark Avatar asked Jul 07 '09 15:07

Bala Clark


1 Answers

Zend_Config_Ini would fit the bill nicely for this:

$config = new Zend_Config_Ini('/path/to/config.ini', 'staging');

echo $config->database->params->host; // prints "dev.example.com"

echo $config->database->params->dbname; // prints "dbname"

like image 126
Andy Baird Avatar answered Sep 24 '22 19:09

Andy Baird