public function details($token, $requestIndex)
 {
     $this->profiler->disable();
     $profile = $this->profiler->loadProfile($token);
     $logs = $profile->getCollector('contentful')->getLogs();
     $logEntry = $logs[$requestIndex];
     return $this->templating->renderResponse('@Contentful/Collector/details.html.twig', ['requestIndex' => $requestIndex, 'entry' => $logEntry]);
 }
 /**
  * @param $profile ->getToken()
  * @param int $qid
  *
  * @return array
  */
 private function getQuery(Profile $profile, $qid)
 {
     $this->profiler->disable();
     $token = $profile->getToken();
     if (!($profile = $this->profiler->loadProfile($token))) {
         throw new NotFoundHttpException($this->t('Token @token does not exist.', ['@token' => $token]));
     }
     /** @var DatabaseDataCollector $databaseCollector */
     $databaseCollector = $profile->getCollector('database');
     $queries = $databaseCollector->getQueries();
     $query = $queries[$qid];
     return $query;
 }
 public function details($token, $requestIndex)
 {
     $this->profiler->disable();
     $profile = $this->profiler->loadProfile($token);
     /**
      * @var CommercetoolsDataCollector $collector
      */
     $collector = $profile->getCollector('commercetools');
     $requests = $collector->getRequestInfos();
     $entry = $requests[$requestIndex];
     if (isset($entry['request']['body']) && strpos($entry['request']['body'], '{') === 0) {
         $entry['request']['body'] = json_encode(json_decode($entry['request']['body'], true), JSON_PRETTY_PRINT);
     }
     if (isset($entry['response']['body']) && strpos($entry['response']['body'], '{') === 0) {
         $entry['response']['body'] = json_encode(json_decode($entry['response']['body'], true), JSON_PRETTY_PRINT);
     }
     return $this->templating->renderResponse('@Ctp/Collector/details.html.twig', ['requestIndex' => $requestIndex, 'entry' => $entry]);
 }
Ejemplo n.º 4
0
 /**
  * Updates database and all related caches according to changes of extended entities
  *
  * @param bool $warmUpConfigCache Whether the entity config cache should be warmed up
  *                                after database schema is changed
  * @param bool $updateRouting     Whether routes should be updated after database schema is changed
  *
  * @return bool
  */
 public function updateDatabase($warmUpConfigCache = false, $updateRouting = false)
 {
     set_time_limit(0);
     // disable Profiler to avoid an exception in DoctrineDataCollector
     // in case if entity classes and Doctrine metadata are not match each other in the current process
     if ($this->profiler) {
         $this->profiler->disable();
     }
     $this->maintenance->activate();
     $commands = ['oro:entity-extend:update-config' => [], 'oro:entity-extend:cache:warmup' => [], 'oro:entity-extend:update-schema' => []];
     if ($warmUpConfigCache) {
         $commands = array_merge($commands, ['oro:entity-config:cache:warmup' => []]);
     }
     if ($updateRouting) {
         $commands = array_merge($commands, ['router:cache:clear' => [], 'fos:js-routing:dump' => []]);
     }
     return $this->executeCommands($commands);
 }
 public function init()
 {
     $this->profiler = $this->get('profiler');
     $this->profiler->disable();
 }