library traceable-pdo
Log SQL statements executed using a PDO instance
maximebf/traceable-pdo
Log SQL statements executed using a PDO instance
- Saturday, August 17, 2013
- by maximebf
- Repository
- 1 Watchers
- 8 Stars
- 7,139 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 17 % Grown
TraceablePDO
, (*1)
Wrapper around PDO to provide information
about executed statements., (*2)
$pdo = new TraceablePDO(new PDO($dsn));
$result = $pdo->query('select * from mytable');
$tracedStmt = $pdo->getLastTracedStatements();
printf("The last query took %sms to execute", $tracedStmt->getDuration());
Also provides a ProxyTraceablePDO for custom PDO sublasses. Wrap your custom
PDO object inside it and property access and method calls will be forwarded., (*3)
Install using composer:, (*4)
{
"require": {
"maximebf/traceable-pdo": "1.*"
}
}