RedisTrait

trait RedisTrait

Methods

init($redisClient, $namespace = '', $defaultLifetime)
static Redis|Client createConnection(string $dsn, array $options = array())

Creates a Redis connection using a DSN configuration.

Details

init($redisClient, $namespace = '', $defaultLifetime)

Parameters

$redisClient
$namespace
$defaultLifetime

static Redis|Client createConnection(string $dsn, array $options = array())

Creates a Redis connection using a DSN configuration.

Example DSN: - redis://localhost - redis://example.com:1234 - redis://[email protected]/13 - redis:///var/run/redis.sock - redis://secret@/var/run/redis.sock/13

Parameters

string $dsn
array $options See self::$defaultConnectionOptions

Return Value

Redis|Client According to the "class" option

Exceptions

InvalidArgumentException when the DSN is invalid

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/Cache/Traits/RedisTrait.html