class MysqlProfilerStorage extends PdoProfilerStorage

deprecated Deprecated since Symfony 2.8, to be removed in Symfony 3.0. Use {@link FileProfilerStorage} instead.

A ProfilerStorage for Mysql.

Properties

protected $dsn from PdoProfilerStorage
protected $username from PdoProfilerStorage
protected $password from PdoProfilerStorage
protected $lifetime from PdoProfilerStorage
protected $db from PdoProfilerStorage

Methods

__construct(string $dsn, string $username = '', string $password = '', int $lifetime = 86400)

No description

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

Finds profiler tokens for the given criteria.

read(string $token)

Reads data associated with the given token.

bool
write(Profile $profile)

Saves a Profile.

purge()

Purges all data from the database.

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

Build SQL criteria to fetch records by ip and url.

initDb()

Initializes the database.

cleanup()

No description

exec($db, $query, array $args = array())

No description

prepareStatement($db, $query)

No description

fetch($db, $query, array $args = array())

No description

close($db)

No description

createProfileFromData($token, $data, $parent = null)

No description

readChildren(string $token, string $parent)

Reads the child profiles for the given token.

string
has(string $token)

Returns whether data for the given token already exists in storage.

Details

in PdoProfilerStorage at line 39
__construct(string $dsn, string $username = '', string $password = '', int $lifetime = 86400)

Parameters

string $dsn A data source name
string $username The username for the database
string $password The password for the database
int $lifetime The lifetime to use for the purge

in PdoProfilerStorage at line 50
array find(string $ip, string $url, string $limit, string $method, int|null $start = null, int|null $end = 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
int|null $start The start date to search from
int|null $end The end date to search to

Return Value

array An array of tokens

in PdoProfilerStorage at line 74
Profile read(string $token)

Reads data associated with the given token.

The method returns false if the token does not exist in the storage.

Parameters

string $token A token

Return Value

Profile The profile associated with token

in PdoProfilerStorage at line 88
bool write(Profile $profile)

Saves a Profile.

Parameters

Profile $profile

Return Value

bool Write operation successful

in PdoProfilerStorage at line 123
purge()

Purges all data from the database.

at line 52
protected array buildCriteria(string $ip, string $url, string $start, string $end, string $limit, string $method)

Build SQL criteria to fetch records by ip and url.

Parameters

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

Return Value

array An array with (criteria, args)

at line 29
protected initDb()

Initializes the database.

Exceptions

RuntimeException When the requested database driver is not installed

in PdoProfilerStorage at line 151
protected cleanup()

in PdoProfilerStorage at line 158
protected exec($db, $query, array $args = array())

Parameters

$db
$query
array $args

in PdoProfilerStorage at line 171
protected prepareStatement($db, $query)

Parameters

$db
$query

in PdoProfilerStorage at line 186
protected fetch($db, $query, array $args = array())

Parameters

$db
$query
array $args

in PdoProfilerStorage at line 198
protected close($db)

Parameters

$db

in PdoProfilerStorage at line 202
protected createProfileFromData($token, $data, $parent = null)

Parameters

$token
$data
$parent

in PdoProfilerStorage at line 232
protected Profile[] readChildren(string $token, string $parent)

Reads the child profiles for the given token.

Parameters

string $token The parent token
string $parent The parent instance

Return Value

Profile[] An array of Profile instance

in PdoProfilerStorage at line 257
protected string has(string $token)

Returns whether data for the given token already exists in storage.

Parameters

string $token The profile token

Return Value

string