anper / predis-command-collector
此包已弃用且不再维护。未建议替代包。
PHP Predis 命令收集器。
v0.4.0
2021-01-07 14:36 UTC
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
安装
$ composer require anper/predis-command-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(); }
函数用法
use Anper\Predis\CommandCollector\Profile; use function Anper\Predis\CommandCollector\register_collector; $collector = function (Profile $profile) { echo $profile->getCommandAsString(); }; register_collector($client, $collector);
测试
$ composer test
贡献
有关详细信息,请参阅CONTRIBUTING。
许可
MIT 许可证 (MIT)。有关更多信息,请参阅许可文件。