PHP code example of reactphp-x / redis-cache

1. Go to this page and download the library: Download reactphp-x/redis-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/ */

    

reactphp-x / redis-cache example snippets


use Clue\React\Redis\RedisClient;
use ReactphpX\RedisCache\RedisCache;
$redis = new RedisClient('redis://:h%40llo@localhost');
// $redis = new RedisClient('redis://ignored:h%40llo@localhost');
// $redis = new RedisClient('redis://localhost?password=h%40llo');
// $redis = new RedisClient('redis://localhost/2');
// $redis = new RedisClient('redis://localhost?db=2');

$redisCache = new RedisCache($redis);