public function FileProfilerStorage::read

Reads data associated with the given token.

The method returns false if the token does not exists 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 drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php

File

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

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 null;
  }
  return $this
    ->createProfileFromData($token, unserialize(file_get_contents($file)));
}