MediaWiki  master
Wikimedia\Rdbms\GeneralizedSql Class Reference

Lazy-loaded wrapper for simplification and scrubbing of SQL queries for profiling. More...

Public Member Functions

 __construct ( $rawSql, $trxId, $prefix)
 
 stringify ()
 

Static Private Member Functions

static generalizeSQL ( $sql)
 Removes most variables from an SQL query and replaces them with X or N for numbers. More...
 

Private Attributes

string null $genericSql
 
string $prefix
 
string $rawSql
 
string $trxId
 

Detailed Description

Lazy-loaded wrapper for simplification and scrubbing of SQL queries for profiling.

Since
1.34

Definition at line 29 of file GeneralizedSql.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Rdbms\GeneralizedSql::__construct (   $rawSql,
  $trxId,
  $prefix 
)
Parameters
string$rawSql
string$trxId
string$prefix

Definition at line 45 of file GeneralizedSql.php.

References Wikimedia\Rdbms\GeneralizedSql\$prefix, Wikimedia\Rdbms\GeneralizedSql\$rawSql, and Wikimedia\Rdbms\GeneralizedSql\$trxId.

Member Function Documentation

◆ generalizeSQL()

static Wikimedia\Rdbms\GeneralizedSql::generalizeSQL (   $sql)
staticprivate

Removes most variables from an SQL query and replaces them with X or N for numbers.

It's only slightly flawed. Don't use for anything important.

Parameters
string$sqlA SQL Query
Returns
string

Definition at line 59 of file GeneralizedSql.php.

◆ stringify()

Wikimedia\Rdbms\GeneralizedSql::stringify ( )
Returns
string

Definition at line 84 of file GeneralizedSql.php.

References Wikimedia\Rdbms\GeneralizedSql\$genericSql.

Referenced by Wikimedia\Rdbms\TransactionProfiler\queryString().

Member Data Documentation

◆ $genericSql

string null Wikimedia\Rdbms\GeneralizedSql::$genericSql
private

Definition at line 38 of file GeneralizedSql.php.

Referenced by Wikimedia\Rdbms\GeneralizedSql\stringify().

◆ $prefix

string Wikimedia\Rdbms\GeneralizedSql::$prefix
private

Definition at line 35 of file GeneralizedSql.php.

Referenced by Wikimedia\Rdbms\GeneralizedSql\__construct().

◆ $rawSql

string Wikimedia\Rdbms\GeneralizedSql::$rawSql
private

Definition at line 31 of file GeneralizedSql.php.

Referenced by Wikimedia\Rdbms\GeneralizedSql\__construct().

◆ $trxId

string Wikimedia\Rdbms\GeneralizedSql::$trxId
private

Definition at line 33 of file GeneralizedSql.php.

Referenced by Wikimedia\Rdbms\GeneralizedSql\__construct().


The documentation for this class was generated from the following file: