You are here

private function RedisProfilerStorage::createProfileFromData in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/Profiler/RedisProfilerStorage.php \Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage::createProfileFromData()
1 call to RedisProfilerStorage::createProfileFromData()
RedisProfilerStorage::read in vendor/symfony/http-kernel/Profiler/RedisProfilerStorage.php
Reads data associated with the given token.

File

vendor/symfony/http-kernel/Profiler/RedisProfilerStorage.php, line 249

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;
}