PHP code example of kba-team / cakephp-predis

1. Go to this page and download the library: Download kba-team/cakephp-predis 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/ */

    

kba-team / cakephp-predis example snippets


CakePlugin::load("PredisCache");

Cache::config('_session_', [
    'engine' => 'PredisCache.Predis',
    'sentinel' => ['<sentinel host 1>', ...., '<sentinel host n>'],
    'password' => "<password>",
    'port' => 26379,
    'exceptions' => true,
    'database' => 1,
    'prefix' => "",
    'duration' => '+2 days', 
]);