anper / predis-command-collector
PHP Predis command collector.
Installs: 2 201
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.1||^8.0
- anper/callable-aggregate: ^0.3
- predis/predis: ^1.1
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/predis-command-collector
Usage collector
use Anper\Predis\CommandCollector\Collector; use function Anper\Predis\CommandCollector\register_collector; $client = new \Predis\Client(...); register_collector($client, $collector = new Collector($client)); // redis queries... foreach($collector->getProfiles() as $profile) { echo $profile->getCommandAsString(); }
Usage function
use Anper\Predis\CommandCollector\Profile; use function Anper\Predis\CommandCollector\register_collector; $collector = function (Profile $profile) { echo $profile->getCommandAsString(); }; register_collector($client, $collector);
Test
$ composer test
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.