anper / pdo-statement-collector
PHP PDO statement collector.
Installs: 2 472
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.1||^8.0
- ext-pdo: *
- anper/callable-aggregate: ^0.3
Requires (Dev)
- phpstan/phpstan: ^0.12.29
- phpunit/phpunit: ^7.0||^8.0||^9.0
- squizlabs/php_codesniffer: ^3.0
README
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.