FileProfilerStorage
in package
implements
ProfilerStorageInterface
Storage for profiler using files.
Tags
Interfaces, Classes and Traits
- ProfilerStorageInterface
Table of Contents
- $folder : string
- Folder where profiler data are stored.
- __construct() : mixed
- Constructs the file storage using a "dsn-like" path.
- find() : array<string|int, mixed>
- {@inheritdoc}
- purge() : mixed
- {@inheritdoc}
- read() : Profile|null
- {@inheritdoc}
- write() : bool
- {@inheritdoc}
- createProfileFromData() : mixed
- getFilename() : string
- Gets filename to store data, associated to the token.
- getIndexFilename() : string
- Gets the index filename.
- readLineFromFile() : mixed
- Reads a line in the file, backward.
- doRead() : Profile|null
Properties
$folder
Folder where profiler data are stored.
private
string
$folder
Methods
__construct()
Constructs the file storage using a "dsn-like" path.
public
__construct(string $dsn) : mixed
Example : "file:/path/to/the/storage/folder"
Parameters
- $dsn : string
Tags
Return values
mixed —find()
{@inheritdoc}
public
find(string|null $ip, string|null $url, int|null $limit, string|null $method[, int|null $start = null ][, int|null $end = null ][, string|null $statusCode = null ]) : array<string|int, mixed>
Parameters
- $ip : string|null
- $url : string|null
- $limit : int|null
- $method : string|null
- $start : int|null = null
- $end : int|null = null
- $statusCode : string|null = null
Return values
array<string|int, mixed> —purge()
{@inheritdoc}
public
purge() : mixed
Return values
mixed —read()
{@inheritdoc}
public
read(string $token) : Profile|null
Parameters
- $token : string
Return values
Profile|null —write()
{@inheritdoc}
public
write(Profile $profile) : bool
Parameters
- $profile : Profile
Tags
Return values
bool —createProfileFromData()
protected
createProfileFromData(string $token, array<string|int, mixed> $data[, Profile|null $parent = null ]) : mixed
Parameters
- $token : string
- $data : array<string|int, mixed>
- $parent : Profile|null = null
Return values
mixed —getFilename()
Gets filename to store data, associated to the token.
protected
getFilename(string $token) : string
Parameters
- $token : string
Return values
string —getIndexFilename()
Gets the index filename.
protected
getIndexFilename() : string
Return values
string —readLineFromFile()
Reads a line in the file, backward.
protected
readLineFromFile(resource $file) : mixed
This function automatically skips the empty lines and do not include the line return in result value.
Parameters
- $file : resource
-
The file resource, with the pointer placed at the end of the line to read
Return values
mixed —doRead()
private
doRead(mixed $token[, Profile|null $profile = null ]) : Profile|null
Parameters
- $token : mixed
- $profile : Profile|null = null