function FileProfilerStorage::doRead
2 calls to FileProfilerStorage::doRead()
- FileProfilerStorage::createProfileFromData in vendor/
symfony/ http-kernel/ Profiler/ FileProfilerStorage.php - FileProfilerStorage::read in vendor/
symfony/ http-kernel/ Profiler/ FileProfilerStorage.php - Reads data associated with the given token.
File
-
vendor/
symfony/ http-kernel/ Profiler/ FileProfilerStorage.php, line 293
Class
- FileProfilerStorage
- Storage for profiler using files.
Namespace
Symfony\Component\HttpKernel\ProfilerCode
private function doRead($token, ?Profile $profile = null) : ?Profile {
if (!$token || !file_exists($file = $this->getFilename($token))) {
return null;
}
$h = fopen($file, 'r');
flock($h, \LOCK_SH);
$data = stream_get_contents($h);
flock($h, \LOCK_UN);
fclose($h);
if (\function_exists('gzdecode')) {
$data = @gzdecode($data) ?: $data;
}
if (!($data = unserialize($data))) {
return null;
}
return $this->createProfileFromData($token, $data, $profile);
}