Class

Symfony\Component\HttpKernel\Profiler\Profiler

class Profiler

Profiler.

Methods

__construct(ProfilerStorageInterface $storage, LoggerInterface $logger = null)

Constructor.

disable()

Disables the profiler.

enable()

Enables the profiler.

Profile loadProfileFromResponse(Response $response)

Loads the Profile for the given Response.

Profile loadProfile(string $token)

Loads the Profile for the given token.

bool saveProfile(Profile $profile)

Saves a Profile.

purge()

Purges all data from the storage.

string export(Profile $profile)

Exports the current profiler data.

Profile import(string $data)

Imports data into the profiler storage.

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

Finds profiler tokens for the given criteria.

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

Collects data for the given Response.

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.

DataCollectorInterface get(string $name)

Gets a Collector by name.

Details

at line 53
public __construct(ProfilerStorageInterface $storage, LoggerInterface $logger = null)

Constructor.

Parameters

ProfilerStorageInterface $storage A ProfilerStorageInterface instance
LoggerInterface $logger A LoggerInterface instance

at line 62
public disable()

Disables the profiler.

at line 70
public enable()

Enables the profiler.

at line 82
public Profile loadProfileFromResponse(Response $response)

Loads the Profile for the given Response.

Parameters

Response $response A Response instance

Return Value

Profile A Profile instance

at line 98
public Profile loadProfile(string $token)

Loads the Profile for the given token.

Parameters

string $token A token

Return Value

Profile A Profile instance

at line 110
public bool saveProfile(Profile $profile)

Saves a Profile.

Parameters

Profile $profile A Profile instance

Return Value

bool

at line 129
public purge()

Purges all data from the storage.

at line 141
public string export(Profile $profile)

Exports the current profiler data.

Parameters

Profile $profile A Profile instance

Return Value

string The exported data

at line 153
public Profile import(string $data)

Imports data into the profiler storage.

Parameters

string $data A data string as exported by the export() method

Return Value

Profile A Profile instance

at line 180
public array find(string $ip, string $url, string $limit, string $method, string $start, string $end)

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

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 194
public Profile|null collect(Request $request, Response $response, Exception $exception = null)

Collects data for the given Response.

Parameters

Request $request A Request instance
Response $response A Response instance
Exception $exception An exception instance if the request threw one

Return Value

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

at line 223
public array all()

Gets the Collectors associated with this profiler.

Return Value

array An array of collectors

at line 233
public set(array $collectors = array())

Sets the Collectors associated with this profiler.

Parameters

array $collectors An array of collectors

at line 246
public add(DataCollectorInterface $collector)

Adds a Collector.

Parameters

DataCollectorInterface $collector A DataCollectorInterface instance

at line 258
public 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 272
public 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