You are here

private function BaseMemcacheProfilerStorage::createProfileFromData in Zircon Profile 8.0

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

File

vendor/symfony/http-kernel/Profiler/BaseMemcacheProfilerStorage.php, line 234

Class

BaseMemcacheProfilerStorage
Base Memcache storage for profiling information in a Memcache.

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)))) {
      continue;
    }
    $profile
      ->addChild($this
      ->createProfileFromData($token, $childProfileData, $profile));
  }
  return $profile;
}