I'm triying to set a "redis" param to the redis session adapter, but it does not work, it tries to connect to the default localhost, since I didn't define a host. Can't I define a redis connection on the adapters? Using phalcon 2.0.8
$di->setShared('redis', function () {
$redis = new \Redis();
$redis->connect($this->config->redis->host, $this->config->redis->port);
return $redis;
});
$di->setShared('session', function () use ($di) {
$session = new Phalcon\Session\Adapter\Redis([
'redis' => $di->getRedis(), // HERE I SET THE ALREADY DEFINED CONNECTION
'persistent' => false,
'lifetime' => 3600,
]);
$session->start();
return $session;
});