PHP code example of oefenweb / cakephp-redis

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

    

oefenweb / cakephp-redis example snippets


CakePlugin::load('Redis');


class DATABASE_CONFIG {

	public $redis = [
		'datasource' => 'Redis.RedisSource',
		'host' => '127.0.0.1',
		'port' => 6379,
		'password' => '',
		'database' => 0,
		'timeout' => 0,
		'persistent' => false,
		'unix_socket' => '',
		'prefix' => '',
	];


App::uses('ConnectionManager', 'Model');

$Redis = ConnectionManager::getDataSource('redis');

$Redis->ping();