• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Redis session driver broken

#1
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined index: timeout
Filename: drivers/Session_redis_driver.php
Line Number: 148

Code:
$config['sess_driver'] = 'redis';
$config['sess_save_path'] = 'tcp://localhost:6379';

I'm assuming timeout should be set in this block?

Code:
        elseif (preg_match('#(?:tcp://)?([^:?]+)(?:\:(\d+))?(?<options>\?.+)?#', $this->_config['save_path'], $matches))
        {
            $save_path = array(
                'host' => $matches[1],
                'port' => empty($matches[2]) ? NULL : $matches[2]
            );
        }
Reply

#2
Line 148 in that file is, and always has been (in released versions) a return statement. I guess you're using an old dev version.
Reply

#3
I'm using the latest code from Git.

https://github.com/bcit-ci/CodeIgniter/b...driver.php construct method, line 148 references $this->_config['save_path']['timeout'] which is not defined with the other keys in construct.
Reply

#4
I came across the same "Undefined index: timeout" error in line 155 of Session_redis_driver.php after updating my system files to the latest CI version 3.1.0-dev today. The quick fix for me was to explicitly set the timeout value in sess_save_path since the code assumes timeout is set: $config['sess_save_path'] = 'tcp://127.0.0.1:6379?timeout=0';
Reply

#5
3.1.0-dev is NOT the latest code and it is UNSTABLE.
Don't use it.
Reply

#6
https://github.com/bcit-ci/CodeIgniter/c...5b51475f74
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.