Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

zendframework/zend-cache adapter to provide RedisCluster support to projects using zend-cache.

Notifications You must be signed in to change notification settings

boesing/zend-cache-redis-cluster

Repository files navigation

zend-cache-redis-cluster

Build Status Coverage Status

zendframework/zend-cache adapter to provide RedisCluster support to projects using zend-cache.

Installation

composer require boesing/zend-cache-redis-cluster

Configuration

use Boesing\ZendCacheRedisCluster\RedisCluster;

return [
    'caches' => [
        /**
         * NOTE: the cluster nodename must exist in your php.ini!
         * If you configure timeout in your php.ini per nodename aswell, there is no need to
         * configure more than the nodename.
         */
        'redis-cluster-cache-with-nodename' => [
            'adapter' => [
                'name' => RedisCluster::class,
                'options' => [
                    'namespace' => '',
                    'namespace_separator' => ':',
                    'nodename' => 'clusternode1',
                    'persistent' => false,
                    // You can provide the redis version by configuration to avoid an info call on each connect
                    'redis_version' => '',
                ],
            ],
        ],
        'redis-cluster-cache-with-seeds' => [
            'adapter' => [
                'name' => RedisCluster::class,
                'options' => [
                    'namespace' => '',
                    'namespace_separator' => ':',
                    'seeds' => ["hostname:port", "hostname2:port2", /* ... */],
                    'timeout' => 1,
                    'readTimeout' => 2,
                    'persistent' => false,
                    // You can provide the redis version by configuration to avoid an info call on each connect
                    'redis_version' => '',
                ],
            ],
        ],
    ],
];

About

zendframework/zend-cache adapter to provide RedisCluster support to projects using zend-cache.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages