PHP Class Barryvdh\Debugbar\DataCollector\QueryCollector

Inheritance: extends DebugBar\DataCollector\PDO\PDOCollector
Afficher le fichier Open project: barryvdh/laravel-debugbar Class Usage Examples

Protected Properties

Свойство Type Description
$explainQuery
$explainTypes
$findSource
$queries
$reflection
$renderSqlWithParams
$showHints ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+
$timeCollector

Méthodes publiques

Méthode Description
__construct ( DebugBar\DataCollector\TimeDataCollector $timeCollector = null )
addQuery ( string $query, array $bindings, float $time, Connection $connection )
collect ( ) {@inheritDoc}
getName ( ) {@inheritDoc}
getWidgets ( ) {@inheritDoc}
reset ( ) Reset the queries.
setExplainSource ( boolean $enabled, array | null $types ) Enable/disable the EXPLAIN queries
setFindSource ( boolean $value = true ) Enable/disable finding the source
setRenderSqlWithParams ( boolean $enabled = true, string $quotationChar = "'" ) Renders the SQL of traced statements with params embedded
setShowHints ( boolean $enabled = true ) Show or hide the hints in the parameters

Méthodes protégées

Méthode Description
checkBindings ( $bindings ) : mixed Check bindings for illegal (non UTF-8) strings, like Binary data.
escapeBindings ( array $bindings ) : array Make the bindings safe for outputting.
findSource ( ) Use a backtrace to search for the origin of the query.
findViewFromHash ( string $hash ) : null | string Find the template name from the hash.
formatSql ( string $sql ) : string Removes extra spaces at the beginning and end of the SQL query and its lines.
getTwigInfo ( array $trace ) : array Get the filename/line from a Twig template trace
normalizeFilename ( string $path ) : string Shorten the path by removing the relative links and base dir
performQueryAnalysis ( string $query ) : string Explainer::performQueryAnalysis()

Method Details

__construct() public méthode

public __construct ( DebugBar\DataCollector\TimeDataCollector $timeCollector = null )
$timeCollector DebugBar\DataCollector\TimeDataCollector

addQuery() public méthode

public addQuery ( string $query, array $bindings, float $time, Connection $connection )
$query string
$bindings array
$time float
$connection Illuminate\Database\Connection

checkBindings() protected méthode

Check bindings for illegal (non UTF-8) strings, like Binary data.
protected checkBindings ( $bindings ) : mixed
$bindings
Résultat mixed

collect() public méthode

{@inheritDoc}
public collect ( )

escapeBindings() protected méthode

Make the bindings safe for outputting.
protected escapeBindings ( array $bindings ) : array
$bindings array
Résultat array

findSource() protected méthode

Use a backtrace to search for the origin of the query.
protected findSource ( )

findViewFromHash() protected méthode

Find the template name from the hash.
protected findViewFromHash ( string $hash ) : null | string
$hash string
Résultat null | string

formatSql() protected méthode

Removes extra spaces at the beginning and end of the SQL query and its lines.
protected formatSql ( string $sql ) : string
$sql string
Résultat string

getName() public méthode

{@inheritDoc}
public getName ( )

getTwigInfo() protected méthode

Get the filename/line from a Twig template trace
protected getTwigInfo ( array $trace ) : array
$trace array
Résultat array The file and line

getWidgets() public méthode

{@inheritDoc}
public getWidgets ( )

normalizeFilename() protected méthode

Shorten the path by removing the relative links and base dir
protected normalizeFilename ( string $path ) : string
$path string
Résultat string

performQueryAnalysis() protected méthode

Perform simple regex analysis on the code
Author: e-doceo
protected performQueryAnalysis ( string $query ) : string
$query string
Résultat string

reset() public méthode

Reset the queries.
public reset ( )

setExplainSource() public méthode

Enable/disable the EXPLAIN queries
public setExplainSource ( boolean $enabled, array | null $types )
$enabled boolean
$types array | null Array of types to explain queries (select/insert/update/delete)

setFindSource() public méthode

Enable/disable finding the source
public setFindSource ( boolean $value = true )
$value boolean

setRenderSqlWithParams() public méthode

Renders the SQL of traced statements with params embedded
public setRenderSqlWithParams ( boolean $enabled = true, string $quotationChar = "'" )
$enabled boolean
$quotationChar string NOT USED

setShowHints() public méthode

Show or hide the hints in the parameters
public setShowHints ( boolean $enabled = true )
$enabled boolean

Property Details

$explainQuery protected_oe property

protected $explainQuery

$explainTypes protected_oe property

protected $explainTypes

$findSource protected_oe property

protected $findSource

$queries protected_oe property

protected $queries

$reflection protected_oe property

protected $reflection

$renderSqlWithParams protected_oe property

protected $renderSqlWithParams

$showHints protected_oe property

['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+
protected $showHints

$timeCollector protected_oe property

protected $timeCollector