final protected static function openConnection($key,
$target) { // If the requested database does not exist then it is an unrecoverable
// error.
if (!
isset(self::
$databaseInfo[$key])) { throw new ConnectionNotDefinedException('The specified database connection is not defined: ' .
$key);
} if (!self::
$databaseInfo[$key][$target]['driver'
]) { throw new DriverNotSpecifiedException('Driver not specified for this database connection: ' .
$key);
} $driver_class = self::
$databaseInfo[$key][$target]['namespace'
] . '\\Connection';
$client_connection =
$driver_class::
open(self::
$databaseInfo[$key][$target]);
$new_connection =
new $driver_class($client_connection, self::
$databaseInfo[$key][$target]);
$new_connection->
setTarget($target);
$new_connection->
setKey($key);
// If we have any active logging objects for this connection key, we need
// to associate them with the connection we just opened.