1. Go to this page and download the library: Download sonata-project/cache library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Sonata\Cache\Adapter\Counter\PRedisCounter;
$adapter = new PRedisCounter([
'host' => '127.0.0.1',
'port' => 6379,
'database' => 42,
]);
$counter = $adapter->increment('mystats');
// $counter is a Counter object
$counter->getValue(); // will return 1 if the counter is new
$counter = $adapter->increment($counter, 10);
$counter->getValue(); // will return 11
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.