I was wondering if it is advisable to use php .ini files to set up a framework. I have like 10 settings to store and since now I was doing that with constants. But I came across these .ini files. You can parse them and get all the variables you need.
Is is advisable to use .ini files to store framework configurations? How should I store them to make them global? Registry class?
Yes it’s perfectly OK and very common in fact. I might recommend that you store them in a configs folder. E.g.
/path/to/docroot/configs(or “config” if you prefer)You could easily parse them using
Zend_Config_Inihttp://framework.zend.com/manual/en/zend.config.adapters.ini.htmlYou don’t have to use the entire framework to use that utility. It’s great and I would recommend it to anyone.
And yes storing it in a registry class is a great idea. The Zend Framework also has
Zend_Registryif you wanted to use that, or just make your own.