In a Symfony controller’s action, how can I find out which database driver is currently being used? Something like
public function testAction(Request $request)
{
// How to accomplish this?
switch ($this->getDoctrine()->getDriverName()) {
case 'pdo_mysql':
// execute MySQL-specific query…
break;
case 'pdo_sqlite':
// execute SQLite-specific query…
break;
default:
// …
}
return $this->render(/* … */);
}