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', > 'emailCellSettings.db' => 'EMAIL_CELL_SETTINGS_FILE', > ); > > foreach($reqdApplicFilesArray as $file => $defineContant) > {define($defineContant, $file);} So you double declare your configuration data? Once as a global array, and a second time as broken out constants? How do you loop over configuration data? 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' => array( /* config */ ), 'db4' => array( /* config */ ), ); Then request it: $db = &$mDb->getConnection( 'db1' ); Which would lookup the db: if( isset( $GLOBALS['interJinn']['databases'][$dbKey] ) ) { $config = $GLOBALS['interJinn']['databases'][$dbKey]; } This is a gross oversimplification of what happens, but essentially a lookup occurs at some point. It seems with constants I'd have to do some fancy string concatenation and checking for defined constants via dynamically built strings since each database configuration would be broken out into a set of scalar constant. I never did like constants for configuration, I never saw what they brought to the table. I see their role for enumerating datatypes or naming constant values within code, but not for configuration of said code. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php