PHP code example of cache / redis-adapter
1. Go to this page and download the library: Download cache/redis-adapter 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/ */
cache / redis-adapter example snippets
use Cache\Adapter\Redis\RedisCachePool;
$client = new Redis();
$client->connect('127.0.0.1', 6379);
$pool = new RedisCachePool($client);
$array = new RedisArray(['127.0.0.1:6379', '127.0.0.2:6379']);
$arrayPool = new RedisCachePool($array);
$cluster = new RedisCluster(null, [
'127.0.0.1:7000',
'127.0.0.1:7001',
'127.0.0.1:7002',
]);
$clusterPool = new RedisCachePool($cluster);