News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Eirik Hoem's Blog:
Simple config management for PHP
May 30, 2008 @ 07:54:50

In a new post to his blog today, Eirik Hoem gives an example of using the parse_ini_file function to work with .ini files as configuration for your application.

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.

His example code gives a sample ini file with database connection information and a MyConfigClass that parses the file and can get or set values in it.

0 comments voice your opinion now!
parseinifile configuration management example


blog comments powered by Disqus

Similar Posts

Web Builder Zone: Real-life closures examples...for real

OpenSky Blog: Inheritance in PHP, or why you want to use an Interface or an Abstract class...

PHPImpact Blog: From Swift Mailer to Zend_Mail

KillerPHP Blog: PHP Interfaces: when and why you should use them instead of classes?

Matthew Weir O'Phinney's Blog: Introducing Phly_Struct and Phly_Config


Community Events





Don't see your event here?
Let us know!


release framework interview introduction developer api code community opinion symfony2 unittest podcast refactor threedevsandamaybe laravel list testing language install series

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework