Skip to content

Commit

Permalink
Merge pull request #1 from sebastien-gallet/master
Browse files Browse the repository at this point in the history
Fix crash in CLI mode
  • Loading branch information
andrey-mokhov authored Feb 8, 2017
2 parents adb374f + 753e729 commit 81f3ce0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Db/Adapter/ProfilingAdapterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
$adapter = new ProfilingAdapter($config['db']);

if (php_sapi_name() == 'cli') {
$logger = new Zend\Log\Logger();
$logger = new \Zend\Log\Logger();
// write queries profiling info to stdout in CLI mode
$writer = new Zend\Log\Writer\Stream('php://output');
$logger->addWriter($writer, Zend\Log\Logger::DEBUG);
$writer = new \Zend\Log\Writer\Stream('php://output');
$logger->addWriter($writer, \Zend\Log\Logger::DEBUG);
$adapter->setProfiler(new Profiler\LoggingProfiler($logger));
} else {
$adapter->setProfiler(new Profiler\Profiler());
Expand All @@ -34,4 +34,4 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
$adapter->injectProfilingStatementPrototype($options);
return $adapter;
}
}
}

0 comments on commit 81f3ce0

Please sign in to comment.