anper/predis-command-collector

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

PHP Predis command collector.

v0.4.0 2021-01-07 14:36 UTC

This package is auto-updated.

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


README

Software License Latest Version on Packagist Build Status

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.