2014-10-04 13:28:04 +02:00
|
|
|
<?php
|
|
|
|
namespace Szurubooru;
|
|
|
|
|
|
|
|
class PDOEx extends \PDO
|
|
|
|
{
|
|
|
|
private $queryCount = 0;
|
2014-10-05 20:25:11 +02:00
|
|
|
private $statements = [];
|
2014-10-04 13:28:04 +02:00
|
|
|
|
|
|
|
public function prepare($statement, $driverOptions = [])
|
|
|
|
{
|
|
|
|
++ $this->queryCount;
|
2014-10-05 20:25:11 +02:00
|
|
|
$this->statements[] = $statement;
|
2014-10-04 13:28:04 +02:00
|
|
|
return parent::prepare($statement, $driverOptions);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getQueryCount()
|
|
|
|
{
|
|
|
|
return $this->queryCount;
|
|
|
|
}
|
2014-10-05 20:25:11 +02:00
|
|
|
|
|
|
|
public function getStatements()
|
|
|
|
{
|
|
|
|
return $this->statements;
|
|
|
|
}
|
2014-10-04 13:28:04 +02:00
|
|
|
}
|