MediaWiki REL1_35
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.
 

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 30 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 46 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 60 of file GeneralizedSql.php.

◆ stringify()

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

Definition at line 85 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 39 of file GeneralizedSql.php.

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

◆ $prefix

string Wikimedia\Rdbms\GeneralizedSql::$prefix
private

Definition at line 36 of file GeneralizedSql.php.

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

◆ $rawSql

string Wikimedia\Rdbms\GeneralizedSql::$rawSql
private

Definition at line 32 of file GeneralizedSql.php.

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

◆ $trxId

string Wikimedia\Rdbms\GeneralizedSql::$trxId
private

Definition at line 34 of file GeneralizedSql.php.

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


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