/**
  * @param DataCollectorInterface $collector
  */
 public function addCollector(DataCollectorInterface $collector, $panelTemplate = null, $toolbarTemplate = null)
 {
     $name = $collector->getName();
     $this->data['collectors'][$name] = $collector;
     $this->data['panelTemplates'][$name] = $panelTemplate;
     $this->data['toolbarTemplates'][$name] = $toolbarTemplate;
 }
예제 #2
0
파일: Profiler.php 프로젝트: ddrozdik/dmaps
 /**
  * {@inheritdoc}
  */
 public function add(DataCollectorInterface $collector)
 {
     // drupal collector should not be disabled
     if ($collector->getName() == 'drupal') {
         parent::add($collector);
     } else {
         if ($this->activeToolbarItems && array_key_exists($collector->getName(), $this->activeToolbarItems) && $this->activeToolbarItems[$collector->getName()] !== '0') {
             parent::add($collector);
         }
     }
 }
예제 #3
0
 /**
  * Adds a Collector.
  *
  * @param DataCollectorInterface $collector A DataCollectorInterface instance
  */
 public function add(DataCollectorInterface $collector)
 {
     $this->collectors[$collector->getName()] = $collector;
 }
예제 #4
0
파일: Time.php 프로젝트: ibrows/rest-bundle
 /**
  * {@inheritdoc}
  * @param TimeDataCollector $dataCollector
  */
 public function convert(DataCollectorInterface $dataCollector)
 {
     return round(microtime(true) * 1000 - $dataCollector->getStartTime()) . ' ms';
 }
예제 #5
0
 /**
  * Adds a Collector.
  *
  * @param DataCollectorInterface $collector
  * @param string                 $toolbar
  * @param string                 $panel
  * @param int                    $priority
  */
 public function add(DataCollectorInterface $collector, $toolbar = null, $panel = null, $priority = 0)
 {
     $this->viewCollectorMap[$collector->getName()] = compact('toolbar', 'panel');
     $this->order[$collector->getName()] = $priority;
     parent::add($collector);
 }
예제 #6
0
파일: Db.php 프로젝트: ibrows/rest-bundle
 /**
  * {@inheritdoc}
  * @param DoctrineDataCollector $dataCollector
  */
 public function convert(DataCollectorInterface $dataCollector)
 {
     return ['mappingErrors' => $dataCollector->getMappingErrors(), 'invalidEntities' => $dataCollector->getInvalidEntityCount(), 'queryCount' => $dataCollector->getQueryCount(), 'queryTime' => round($dataCollector->getTime()) . ' ms'];
 }
예제 #7
0
 /**
  * {@inheritdoc}
  * @param MemoryDataCollector $dataCollector
  */
 public function convert(DataCollectorInterface $dataCollector)
 {
     return $this->formatBytes($dataCollector->getMemory());
 }
예제 #8
0
 /**
  * {@inheritdoc}
  * @param SecurityDataCollector $dataCollector
  */
 public function convert(DataCollectorInterface $dataCollector)
 {
     return ['enabled' => $dataCollector->isEnabled(), 'user' => (string) $dataCollector->getUser(), 'roles' => $dataCollector->getRoles(), 'authenticated' => $dataCollector->isAuthenticated(), 'token' => $dataCollector->getTokenClass()];
 }