anper/pdo-statement-collector

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

PHP PDO statement collector.

v0.7.0 2021-01-08 13:38 UTC

This package is auto-updated.

Last update: 2022-06-16 09:55:30 UTC


README

Software License Latest Version on Packagist Build Status

Install

$ composer require anper/pdo-statement-collector

Usage collector

use Anper\Pdo\StatementCollector\Collector;
use function Anper\Pdo\StatementCollector\register_collector;

$pdo = new \PDO(...);

register_collector($pdo, $collector = new Collector());

// pdo queries...

foreach($collector->getProfiles() as $profile) {
    var_dump($profile);
}

Usage function

use Anper\Pdo\StatementCollector\Profile;
use function Anper\Pdo\StatementCollector\register_collector;

$collector = function (Profile $profile) {
    var_dump($profile);
};

register_collector($pdo, $collector);

Test

$ composer test

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.