MediaWiki master
GeneralizedSql.php
Go to the documentation of this file.
1<?php
20namespace Wikimedia\Rdbms;
21
31 private $rawSql;
33 private $prefix;
34
36 private $genericSql;
37
42 public function __construct( $rawSql, $prefix ) {
43 $this->rawSql = $rawSql;
44 $this->prefix = $prefix;
45 }
46
50 public function stringify() {
51 if ( $this->genericSql !== null ) {
52 return $this->genericSql;
53 }
54
55 $this->genericSql = $this->prefix .
56 substr( QueryBuilderFromRawSql::generalizeSQL( $this->rawSql ), 0, 255 );
57
58 return $this->genericSql;
59 }
60
61 public function getRawSql() {
62 return $this->rawSql;
63 }
64}
Lazy-loaded wrapper for simplification and scrubbing of SQL queries for profiling.