Predis
Categories
Component ID
2302285
Component name
Predis
Component type
module
Maintenance status
Development status
Component security advisory coverage
not-covered
Component created
Component changed
Component body
This module provides a service connection to Redis using Predis library, this module only provides a service to be used in other modules.
How to install
This module need Predis in the root composer.json, you need use composer
$ cd /path/to/drupal/8
$ php composer.phar require predis/predis:~0.8.0
$ drush dl predis
$ drush en predis
How to use
# my_module.services.yml
services:
my_module.connection:
class: Drupalmy_moduleConnection
arguments: ['@predis.connection']
use DrupalpredisRedisConnectionInterface;
// ...
public function __construct(RedisConnectionInterface $redis) {
$this->redis = $redis->getConnection();
}
// ...
Related modules: