petflow/query-log

A light-weight query logging utility.

Installs: 316

Dependents: 0

Stars: 1

Watchers: 9

Language: PHP

0.1.1 2014-05-12 22:56 UTC

README

A simple query logging utility, with built in benchmarking.

Usage

use Petflow\QueryLog\QueryLog;

$queryLog = new QueryLog;

$query = "SELECT * FROM users WHERE user_id = ?;";
$bindings = array('user_id' => $user_id);

$queryLog->start();
// do query here
$queryLog->stop();

// automatically calculates elapsed time
$queryLog->addElapsed($query, $bindings);

$log = $queryLog->getQueryLog();