1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 14:16:39 +02:00

DibiExtension22: added $debugMode to constructor

This commit is contained in:
David Grudl
2017-06-09 12:18:53 +02:00
parent 8dc5567bdd
commit e891bdd862

View File

@@ -16,15 +16,28 @@ use Nette;
*/ */
class DibiExtension22 extends Nette\DI\CompilerExtension class DibiExtension22 extends Nette\DI\CompilerExtension
{ {
/** @var bool */
private $debugMode;
public function __construct($debugMode = NULL)
{
$this->debugMode = $debugMode;
}
public function loadConfiguration() public function loadConfiguration()
{ {
$container = $this->getContainerBuilder(); $container = $this->getContainerBuilder();
$config = $this->getConfig(); $config = $this->getConfig();
if ($this->debugMode === NULL) {
$this->debugMode = $container->parameters['debugMode'];
}
$useProfiler = isset($config['profiler']) $useProfiler = isset($config['profiler'])
? $config['profiler'] ? $config['profiler']
: class_exists('Tracy\Debugger') && $container->parameters['debugMode']; : class_exists('Tracy\Debugger') && $this->debugMode;
unset($config['profiler']); unset($config['profiler']);