Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FileProfilerStorage.php

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\Profiler

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal