class Profiler

Profiler.

Methods

__construct(ProfilerStorageInterface $storage, LoggerInterface $logger = null, bool $enable = true)

No description

disable()

Disables the profiler.

enable()

Enables the profiler.

Profile|false
loadProfileFromResponse(Response $response)

Loads the Profile for the given Response.

loadProfile(string $token)

Loads the Profile for the given token.

bool
saveProfile(Profile $profile)

Saves a Profile.

purge()

Purges all data from the storage.

array
find(string $ip, string $url, string $limit, string $method, string $start, string $end, string $statusCode = null)

Finds profiler tokens for the given criteria.

Profile|null
collect(Request $request, Response $response, Exception $exception = null)

Collects data for the given Response.

reset()

No description

array
all()

Gets the Collectors associated with this profiler.

set(array $collectors = array())

Sets the Collectors associated with this profiler.

add(DataCollectorInterface $collector)

Adds a Collector.

bool
has(string $name)

Returns true if a Collector for the given name exists.

get(string $name)

Gets a Collector by name.

Details

at line line 39
__construct(ProfilerStorageInterface $storage, LoggerInterface $logger = null, bool $enable = true)

Parameters

ProfilerStorageInterface $storage
LoggerInterface $logger
bool $enable

at line line 49
disable()

Disables the profiler.

at line line 57
enable()

Enables the profiler.

at line line 67
Profile|false loadProfileFromResponse(Response $response)

Loads the Profile for the given Response.

Parameters

Response $response

Return Value

Profile|false A Profile instance

at line line 83
Profile loadProfile(string $token)

Loads the Profile for the given token.

Parameters

string $token A token

Return Value

Profile A Profile instance

at line line 93
bool saveProfile(Profile $profile)

Saves a Profile.

Parameters

Profile $profile

Return Value

bool

at line line 112
purge()

Purges all data from the storage.

at line line 132
array find(string $ip, string $url, string $limit, string $method, string $start, string $end, string $statusCode = null)

Finds profiler tokens for the given criteria.

Parameters

string $ip The IP
string $url The URL
string $limit The maximum number of tokens to return
string $method The request method
string $start The start date to search from
string $end The end date to search to
string $statusCode The request status code

Return Value

array An array of tokens

See also

http://php.net/manual/en/datetime.formats.php for the supported date/time formats

at line line 142
Profile|null collect(Request $request, Response $response, Exception $exception = null)

Collects data for the given Response.

Parameters

Request $request
Response $response
Exception $exception

Return Value

Profile|null A Profile instance or null if the profiler is disabled

at line line 171
reset()

at line line 184
array all()

Gets the Collectors associated with this profiler.

Return Value

array An array of collectors

at line line 194
set(array $collectors = array())

Sets the Collectors associated with this profiler.

Parameters

array $collectors An array of collectors

at line line 205
add(DataCollectorInterface $collector)

Adds a Collector.

Parameters

DataCollectorInterface $collector

at line line 217
bool has(string $name)

Returns true if a Collector for the given name exists.

Parameters

string $name A collector name

Return Value

bool

at line line 231
DataCollectorInterface get(string $name)

Gets a Collector by name.

Parameters

string $name A collector name

Return Value

DataCollectorInterface A DataCollectorInterface instance

Exceptions

InvalidArgumentException if the collector does not exist