Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

never call DB Adapter service if no 'db' config provided #218

Merged
merged 2 commits into from
Sep 8, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,15 @@ public function getServiceConfig()
$p = false;
$db = new Collector\DbCollector();

if ($sm->has('Zend\Db\Adapter\Adapter')) {
if ($sm->has('Zend\Db\Adapter\Adapter') && isset($sm->get('config')['db'])) {
$adapter = $sm->get('Zend\Db\Adapter\Adapter');
if ($adapter instanceof ProfilingAdapter) {
$p = true;
$db->setProfiler($adapter->getProfiler());
}
}

if (! $p && $sm->has('Zend\Db\Adapter\AdapterInterface')) {
if (! $p && $sm->has('Zend\Db\Adapter\AdapterInterface') && isset($sm->get('config')['db'])) {
$adapter = $sm->get('Zend\Db\Adapter\AdapterInterface');
if ($adapter instanceof ProfilingAdapter) {
$p = true;
Expand Down