Esempio n. 1
0
 /**
  * Enable or disable the profiler.  If $enable is false, the profiler
  * is disabled and will not log any queries sent to it.
  *
  * @param  boolean $enable
  * @return \Zend\Db\Profiler Provides a fluent interface
  */
 public function setEnabled($enable)
 {
     parent::setEnabled($enable);
     if ($this->getEnabled()) {
         if (!$this->_message) {
             $this->_message = new \Zend\Wildfire\Plugin\FirePhp\TableMessage($this->_label);
             $this->_message->setBuffered(true);
             $this->_message->setHeader(array('Time', 'Event', 'Parameters'));
             $this->_message->setDestroy(true);
             $this->_message->setOption('includeLineNumbers', false);
             \Zend\Wildfire\Plugin\FirePhp\FirePhp::getInstance()->send($this->_message);
         }
     } else {
         if ($this->_message) {
             $this->_message->setDestroy(true);
             $this->_message = null;
         }
     }
     return $this;
 }
Esempio n. 2
0
 /**
  * Log a message to the Firebug Console.
  *
  * @param array $event The event data
  * @return void
  */
 protected function _write($event)
 {
     if (!$this->getEnabled()) {
         return;
     }
     if (array_key_exists($event['priority'], $this->_priorityStyles)) {
         $type = $this->_priorityStyles[$event['priority']];
     } else {
         $type = $this->_defaultPriorityStyle;
     }
     $message = $this->_formatter->format($event);
     $label = isset($event['firebugLabel']) ? $event['firebugLabel'] : null;
     FirePhp\FirePhp::getInstance()->send($message, $label, $type, array('traceOffset' => 6));
 }