Re: Discussion of method -- config files

From: Date: Fri, 20 Jun 2008 13:42:11 +0000
Subject: Re: Discussion of method -- config files
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-275697@lists.php.net to get a copy of this message
At 8:07 AM -0400 6/20/08, Al wrote:
I freely use defined constants for all fixed variables in my config file. It insures they cannot be inadvertently reassigned by a function someplace and are available everywhere. define('MYSQL_HOST',"localhost");
Constants are a good solution for this, but I hate UPPERCASE (I'm not postal). :-) I may go against convention and use lowercase and start constants with an underscore, something like this: define('_dbname', 'subscribers'); After all, variables start with a "$", so why can't constants start with "_ "? That seems kind of symmetrical to me. Opinions, possible problems, advice? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#275697) next »