protected function checkDatabaseConnection()
{
if ($this['debug']) {
return;
}
try {
$this['db']->connect();
} catch (\Doctrine\DBAL\DBALException $e) {
$this['monolog']->error($e->getMessage());
$this['twig.path'] = array(__DIR__ . '/Resource/template/exception');
$html = $this['twig']->render('error.twig', array('error_title' => 'データーベース接続エラー', 'error_message' => 'データーベースを確認してください'));
$response = new Response();
$response->setContent($html);
$response->setStatusCode('500');
$response->headers->set('Content-Type', 'text/html');
$response->send();
die;
}
return true;
}