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


$client = new \Redis();
$client->connect('127.0.0.1', 6379);
$pool = new RedisCachePool($client);

$client = new \RedisArray(['127.0.0.1:6379', '127.0.0.2:6379']);
$pool = new RedisCachePool($client);

$client = new \RedisCluster(null, ['127.0.0.1:7000', '127.0.0.2:7001', '127.0.0.2:7002',]);
$pool = new RedisCachePool($client);