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' => 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.

That's damned slick -- as I said, it pays to read your post.

Thanks,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to