$ 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
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.