private function prepareDBALConfiguration(array $config = array())
{
$dbalConfig = $config['dbal'];
$defaultConnectionName = isset($dbalConfig['defaultConnection']) ? $dbalConfig['defaultConnection'] : $this->defaultConnection;
unset($dbalConfig['defaultConnection']);
$defaultConnection = array('eventManagerClass' => 'Doctrine\\Common\\EventManager', 'eventSubscribers' => array(), 'configurationClass' => 'Doctrine\\DBAL\\Configuration', 'sqlLoggerClass' => null, 'sqlLoggerParams' => null, 'types' => array(), 'parameters' => array('wrapperClass' => null, 'driver' => 'pdo_mysql', 'host' => 'localhost', 'user' => 'root', 'password' => null, 'port' => null, 'driverOptions' => array()));
$connections = array();
if (isset($dbalConfig['connections'])) {
$configConnections = $dbalConfig['connections'];
foreach ($configConnections as $name => $connection) {
$name = isset($connection['id']) ? $connection['id'] : $name;
$connections[$name] = array_replace_recursive($defaultConnection, $connection);
}
} else {
$connections = array($defaultConnectionName => array_replace_recursive($defaultConnection, $dbalConfig));
}
return array('defaultConnection' => $defaultConnectionName, 'connections' => $connections);
}