petflow/query-log

This package is abandoned and no longer maintained. No replacement package was suggested.

A light-weight query logging utility.

0.1.1 2014-05-12 22:56 UTC

This package is not auto-updated.

Last update: 2017-01-06 18:07:29 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();