private function RedisProfilerStorage::createProfileFromData

1 call to RedisProfilerStorage::createProfileFromData()
RedisProfilerStorage::read in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php
Reads data associated with the given token.

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php, line 236

Class

RedisProfilerStorage
RedisProfilerStorage stores profiling information in Redis.

Namespace

Symfony\Component\HttpKernel\Profiler

Code

private function createProfileFromData($token, $data, $parent = null) {
  $profile = new Profile($token);
  $profile
    ->setIp($data['ip']);
  $profile
    ->setMethod($data['method']);
  $profile
    ->setUrl($data['url']);
  $profile
    ->setTime($data['time']);
  $profile
    ->setCollectors($data['data']);
  if (!$parent && $data['parent']) {
    $parent = $this
      ->read($data['parent']);
  }
  if ($parent) {
    $profile
      ->setParent($parent);
  }
  foreach ($data['children'] as $token) {
    if (!$token) {
      continue;
    }
    if (!($childProfileData = $this
      ->getValue($this
      ->getItemName($token), self::REDIS_SERIALIZER_PHP))) {
      continue;
    }
    $profile
      ->addChild($this
      ->createProfileFromData($token, $childProfileData, $profile));
  }
  return $profile;
}