RedisTrait

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://secret@example.com/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/3.3/Symfony/Component/Cache/Traits/RedisTrait.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部