[PHP] Re: Discussion of method -- config files

2008-06-20 Thread Al
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); tedd wrote: Hi gang: More of a question of method rather than of right or wrong

Re: [PHP] Re: Discussion of method -- config files

2008-06-20 Thread Iv Ray
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. That's a good idea, I have been thinking about this. Never thought they have global scope, though - a

[PHP] Re: Discussion of method -- config files

2008-06-20 Thread tedd
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,

Re: [PHP] Re: Discussion of method -- config files

2008-06-20 Thread Robert Cummings
On Fri, 2008-06-20 at 08:07 -0400, Al wrote: I freely use defined constants for all fixed variables in my config file. I guess you have no fixed array values since constants don't support non-scalars. The nice thing about arrays is how they group related configuration entries together. Cheers,

Re: [PHP] Re: Discussion of method -- config files

2008-06-20 Thread Al
Not so Robert, here's how I typically handle such situations. $reqdApplicFilesArray = array(// *Required application files and define() value 'regAdminSettings.db' = 'ADMIN_SETTINGS_FILE', 'regMemberData.db' = 'MEMBER_DATA_FILE', 'emailCellSettings.db' = 'EMAIL_CELL_SETTINGS_FILE', );

Re: [PHP] Re: Discussion of method -- config files

2008-06-20 Thread Robert Cummings
On Fri, 2008-06-20 at 11:32 -0400, Al wrote: Not so Robert, here's how I typically handle such situations. $reqdApplicFilesArray = array(// *Required application files and define() value 'regAdminSettings.db' = 'ADMIN_SETTINGS_FILE', 'regMemberData.db' = 'MEMBER_DATA_FILE',

Re: [PHP] Re: Discussion of method -- config files

2008-06-20 Thread tedd
At 11:16 AM -0400 6/20/08, Robert Cummings wrote: On Fri, 2008-06-20 at 08:07 -0400, Al wrote: I freely use defined constants for all fixed variables in my config file. I guess you have no fixed array values since constants don't support non-scalars. The nice thing about arrays is how they

Re: [PHP] Re: Discussion of method -- config files

2008-06-20 Thread tedd
At 11:32 AM -0400 6/20/08, Al wrote: Not so Robert, here's how I typically handle such situations. $reqdApplicFilesArray = array(// *Required application files and define() value 'regAdminSettings.db' = 'ADMIN_SETTINGS_FILE', 'regMemberData.db' = 'MEMBER_DATA_FILE', 'emailCellSettings.db' =

Re: [PHP] Re: Discussion of method -- config files

2008-06-20 Thread tedd
At 12:11 PM -0400 6/20/08, Robert Cummings wrote: For instance I define multiple aliases databases and perform a lookup into the database configuration via the key: $GLOBALS['interJinn']['databases'] = array ( 'db1' = array( /* config */ ), 'db2' = array( /* config */ ), 'db3' =

Re: [PHP] Re: Discussion of method -- config files

2008-06-20 Thread Al
$reqdApplicFilesArray is not a global array [as in $GLOBALS]; it's simply a convenient way to list the variables I want to be globally available. The simple foreach defines them. Robert Cummings wrote: On Fri, 2008-06-20 at 11:32 -0400, Al wrote: Not so Robert, here's how I typically handle