Describe the bug
Session Redis Wrong number of parameters
Steps to reproduce the behavior:
<?php
use Phalcon\Session\Manager;
use Phalcon\Storage\AdapterFactory;
use Phalcon\Session\Adapter\Redis;
$options = [
'host' => '127.0.0.1',
'port' => 6379,
'index' => '1',
];
$session = new Manager();
$factory = new AdapterFactory();
$redis = new Redis($factory, $options);
$session
->setAdapter($redis)
->start();
Provide minimal script to reproduce the issue
Error : Wrong number of parameters
Details
You're missing your serializer. https://docs.phalcon.io/4.0/en/api/phalcon_storage#methods-7
<?php
use Phalcon\Session\Manager;
use Phalcon\Storage\AdapterFactory;
use Phalcon\Session\Adapter\Redis;
use Phalcon\Storage\SerializerFactory;
$options = [
'host' => '127.0.0.1',
'port' => 6379,
'index' => '1',
];
$session = new Manager();
$serializer = new SerializerFactory();
$factory = new AdapterFactory($serializer);
$redis = new Redis($factory, $options);
$session
->setAdapter($redis)
->start();
@duongkhoangiam Can you please test this and close the bug if this works for you?
Yes working , so need edit document in phalcon.io
https://docs.phalcon.io/4.0/en/session#redis
@duongkhoangiam I would recommend you to use https://github.com/phalcon/ide-stubs, as it will save you quite a lot of time regarding reading docs.
I added the relevant section in the docs. Thanks @duongkhoangiam for pointing this out.