Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/233.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Symfony控制器:当前正在使用哪个数据库驱动程序?_Php_Symfony - Fatal编程技术网

Php Symfony控制器:当前正在使用哪个数据库驱动程序?

Php Symfony控制器:当前正在使用哪个数据库驱动程序?,php,symfony,Php,Symfony,在Symfony控制器的操作中,如何找出当前正在使用的数据库驱动程序?差不多 公共函数testActionRequest$request { //如何做到这一点? 切换$this->getDoctrine->getDriverName{ 案例“pdo_mysql”: //执行特定于MySQL的查询… 打破 案例“pdo_sqlite”: //执行特定于SQLite的查询… 打破 违约: // … } 返回$this->render/*…*/; } 您可以使用$this->getdoctor->g

在Symfony控制器的操作中,如何找出当前正在使用的数据库驱动程序?差不多

公共函数testActionRequest$request { //如何做到这一点? 切换$this->getDoctrine->getDriverName{ 案例“pdo_mysql”: //执行特定于MySQL的查询… 打破 案例“pdo_sqlite”: //执行特定于SQLite的查询… 打破 违约: // … } 返回$this->render/*…*/; } 您可以使用$this->getdoctor->getConnection->getDriver getConnection将返回对象。您可以在该对象中访问其所有详细信息

Ref

您可以使用$this->getdoctor->getConnection->getDriver getConnection将返回对象。您可以在该对象中访问其所有详细信息


Ref

谢谢!确切地说,这是$this->getdoctor->getConnection->getDriver->getName我一直想要的。另外,您所说的“将连接对象”是什么意思?getConnection不会返回任何对象。您可以访问该对象中的所有详细信息谢谢!确切地说,这是$this->getdoctor->getConnection->getDriver->getName我一直想要的。另外,您所说的“将连接对象”是什么意思?getConnection不会返回任何对象。您可以在该对象中访问其所有详细信息