Vote early, vote often! When you help pick the links, you'll like DZone better. Login and vote now.
By eirikhm
via blog.eirikhoem.net
Published: May 30 2008 / 10:50
When doing complex applications it’s often nice to have some sort of system for handling settings. PHP has a nice function called parse_ini_file which can be used to create a basic but still usable setting file feature. A simple class which loads the configuration file and offers some methods to retrieve the values for a given key is all that’s needed
Comments
topbit replied ago:
Zend_Config allows access as an object, or array, and also allows for extendable/overrideable sections:
[live]
db.host = 127.0.0.1
db.password = secret
[dev: live]
db.password =password
Gregg Bolinger replied ago:
The fact that something like this makes it to the front page of DZone makes me laugh and you can tell its entirely based on Clicks (338) but notice there are only 6 up votes. It would be like me writing an article on java.util.Properties, everyone clicking it thinking I might show something worth while, rolling their eyes, and moving on.
Voters For This Link (7)
Voters Against This Link (3)