protected function __construct(array $arrConfig)
{
// Deprecated since Contao 4.0, to be removed in Contao 5.0
if (!empty($arrConfig)) {
@trigger_error('Passing a custom configuration to Database::__construct() has been deprecated and will no longer work in Contao 5.0.', E_USER_DEPRECATED);
$arrParams = array('driver' => \System::getContainer()->getParameter('database_driver'), 'host' => $arrConfig['dbHost'], 'port' => $arrConfig['dbPort'], 'user' => $arrConfig['dbUser'], 'password' => $arrConfig['dbPass'], 'dbname' => $arrConfig['dbDatabase']);
$this->resConnection = DriverManager::getConnection($arrParams);
} else {
$this->resConnection = \System::getContainer()->get('database_connection');
}
if (!is_object($this->resConnection)) {
throw new \Exception(sprintf('Could not connect to database (%s)', $this->error));
}
}