News Feed
Sections




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

Vidyut Luther's Blog:
"Where do you 'define' your environment variables" ...update/workaround/s
January 23, 2006 @ 06:41:21

On his blog, phpcult.com, today, Vidyut Luther has posted an update to his previous post asking where people usually define their settings.

My last post created a lot of conversation about how one should go about setting configuration options for your code. I realized, no one mentioned the use of PHP's built in parse_ini_file.

function. This seems to address my problems with one large monolothic file pretty easily. I can still have a globals.conf.php which handles global settings, but I can also use this ini file, to load specific things that are only necessary for modules on an as needed basis. The global scope would be aware of the CONFIG_FILE constant, and I can parse specific sections of it whenever I need to.

He notes that he'll try it in the next few days, but I imagine he'll like what he sees - especially if he's looking for a simple, external way to change information in a file and have it affect the entire app (without changing code).

0 comments voice your opinion now!
define environment variables update parse_ini_file define environment variables update parse_ini_file


blog comments powered by Disqus

Similar Posts

Aaron McGowan: Finally generators exist as of PHP 5.5

CodeGear.com: Borland Announced Delphi for PHP

Community News: Zend Framework Security Upgrade (Zend_XmlRpc XXE Issue)

PHPBuilder.com: Harness the Scripting Power of PHP and cURL to Update Facebook

Chris Hartjes' Blog: Handling Multiple Environments In Your PHP Application


Community Events





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


language composer introduction application version update laravel security tool series interview opinion symfony podcast library framework release voicesoftheelephpant community package

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