You are here

public function FileProfilerStorage::read in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php \Symfony\Component\HttpKernel\Profiler\FileProfilerStorage::read()

Reads data associated with the given token.

The method returns false if the token does not exist in the storage.

Parameters

string $token A token:

Return value

Profile The profile associated with token

Overrides ProfilerStorageInterface::read

1 call to FileProfilerStorage::read()
FileProfilerStorage::createProfileFromData in vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php

File

vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php, line 120

Class

FileProfilerStorage
Storage for profiler using files.

Namespace

Symfony\Component\HttpKernel\Profiler

Code

public function read($token) {
  if (!$token || !file_exists($file = $this
    ->getFilename($token))) {
    return;
  }
  return $this
    ->createProfileFromData($token, unserialize(file_get_contents($file)));
}