Exemple #1
0
 public function register(DibiConnection $connection)
 {
     if (is_callable('Nette\\Diagnostics\\Debugger::enable') && !class_exists('NDebugger')) {
         class_alias('Nette\\Diagnostics\\Debugger', 'NDebugger');
         // PHP 5.2 code compatibility
     }
     if (is_callable('NDebugger::enable') && is_callable('NDebugger::getBlueScreen')) {
         // Nette Framework 2.1
         NDebugger::getBar()->addPanel($this);
         NDebugger::getBlueScreen()->addPanel(array(__CLASS__, 'renderException'));
         $connection->onEvent[] = array($this, 'logEvent');
     } elseif (is_callable('NDebugger::enable')) {
         // Nette Framework 2.0 (for PHP 5.3 or PHP 5.2 prefixed)
         NDebugger::$bar && NDebugger::$bar->addPanel($this);
         NDebugger::$blueScreen && NDebugger::$blueScreen->addPanel(array(__CLASS__, 'renderException'), __CLASS__);
         $connection->onEvent[] = array($this, 'logEvent');
     } elseif (is_callable('Debugger::enable') && !is_callable('Debugger::getBlueScreen')) {
         // Nette Framework 2.0 for PHP 5.2 non-prefixed
         Debugger::$bar && Debugger::$bar->addPanel($this);
         Debugger::$blueScreen && Debugger::$blueScreen->addPanel(array(__CLASS__, 'renderException'), __CLASS__);
         $connection->onEvent[] = array($this, 'logEvent');
     }
 }
Exemple #2
0
 function register(DibiConnection $connection)
 {
     if (is_callable('Nette\\Diagnostics\\Debugger::enable') && !class_exists('NDebugger')) {
         class_alias('Nette\\Diagnostics\\Debugger', 'NDebugger');
     }
     if (is_callable('NDebugger::enable') && is_callable('NDebugger::getBlueScreen')) {
         NDebugger::getBar()->addPanel($this);
         NDebugger::getBlueScreen()->addPanel(array(__CLASS__, 'renderException'));
         $connection->onEvent[] = array($this, 'logEvent');
     } elseif (is_callable('NDebugger::enable')) {
         NDebugger::$bar && NDebugger::$bar->addPanel($this);
         NDebugger::$blueScreen && NDebugger::$blueScreen->addPanel(array(__CLASS__, 'renderException'), __CLASS__);
         $connection->onEvent[] = array($this, 'logEvent');
     } elseif (is_callable('Debugger::enable') && !is_callable('Debugger::getBlueScreen')) {
         Debugger::$bar && Debugger::$bar->addPanel($this);
         Debugger::$blueScreen && Debugger::$blueScreen->addPanel(array(__CLASS__, 'renderException'), __CLASS__);
         $connection->onEvent[] = array($this, 'logEvent');
     }
 }