Php Zend Framework 2条令2 BJ Younglbood Profiler报告未定义的索引数据库
我正在建立一个新的Zend Framework 2 Doctrine 2应用程序,其中包括BJ Youngblood的profiler。但是,在包含它之后,我现在在Php Zend Framework 2条令2 BJ Younglbood Profiler报告未定义的索引数据库,php,mysql,doctrine-orm,zend-framework2,Php,Mysql,Doctrine Orm,Zend Framework2,我正在建立一个新的Zend Framework 2 Doctrine 2应用程序,其中包括BJ Youngblood的profiler。但是,在包含它之后,我现在在ProfilingAdapterFactory.php中收到错误未定义索引:db。/config/autoload中的My doctor.local.php包含我的所有数据库参数。ProfilingAdapterFactory尚未编辑的内容如下: public function createService(ServiceLocator
ProfilingAdapterFactory.php
中收到错误未定义索引:db
。/config/autoload中的My doctor.local.php包含我的所有数据库参数。ProfilingAdapterFactory尚未编辑的内容如下:
public function createService(ServiceLocatorInterface $serviceLocator)
{
$config = $serviceLocator->get('Configuration');
$dbParams = $config['db'];
$adapter = new ProfilingAdapter($dbParams);
$adapter->setProfiler(new Profiler);
if (isset($dbParams['options']) && is_array($dbParams['options'])) {
$options = $dbParams['options'];
} else {
$options = array();
}
$adapter->injectProfilingStatementPrototype($options);
return $adapter;
}
如何调整ProfiliingAdapterFactory.php以查看条令数据库参数?Youngblood的profiler用于Zend\Db评测。 如果您需要一个用于Doctrine ORM的分析器,它已经包含在用于ZF2的Doctrine ORM模块中,所以您所需要做的就是通过composer以及zend developer工具安装此模块
"doctrine/doctrine-orm-module" : "0.*",
"zendframework/zend-developer-tools" : "dev-master",
你能展示一下你的配置文件吗。。。