2017 © Pedro Peláez
 

library zend3-cache-predis

Redis adapter for Zend Framework 3 with tagging support

image

cytec/zend3-cache-predis

Redis adapter for Zend Framework 3 with tagging support

  • Thursday, May 3, 2018
  • by ptodorov
  • Repository
  • 3 Watchers
  • 0 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 24 % Grown

The README.md

cytec/laminas-cache-predis

Redis adapter for Laminas framework with tagging support, (*1)

Installation

composer require cytec/laminas-cache-predis

Configuration

Somewhere in your configuration (eg. config/autoload/global.php) add, (*2)

...
'caches' => [
    'AppCache' => [
        'adapter' => 'Cytec\Cache\Storage\Adapter\Predis',
        'options' => [
            'ttl' => 600,
            'predis_client_connections' => [
                'host' => '127.0.0.1',
                'port' => 6379,
            ],
            'predis_client_options' => [
                'profile' => '2.4',
                'prefix'  => 'ns:'
            ]
        ],
        'plugins' => [
            ['name' => 'serializer']
        ],
    ]
],
...

Since laminas-cache v3 storage adapters need to be registered as modules:, (*3)

modules.config.php:, (*4)

<?php

return [
    ...{your other modules}...
    'Cytec\Cache\Storage\Adapter\Predis',
];

The predis_client_connections option is passed directly as the first argument when creating the Predis client and predis_client_options as the second parameter:, (*5)

$client = new Predis\Client($predis_client_connections, $predis_client_options);

For more information check out Predis documentation on Connection Parameters and Client Options, (*6)

And then you can get the cache via the service manager:, (*7)

$cache = $this->getServiceManager()->get('AppCache');
$cache->setItem($key, $value);

The Versions

03/05 2018

dev-master

9999999-dev https://github.com/cytecbg/zend3-cache-predis

Redis adapter for Zend Framework 3 with tagging support

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

cache redis predis zf2 zf3 taggable tag

02/05 2018

0.0.2

0.0.2.0 https://github.com/cytecbg/zend3-cache-predis

Redis adapter for Zend Framework 3 with tagging support

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

cache redis predis zf2 zf3 taggable tag

02/05 2018

0.0.1

0.0.1.0 https://github.com/cytecbg/zend3-cache-predis

Redis adapter for Zend Framework 3 with tagging support

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

cache redis predis zf2 zf3 taggable tag