Closed brandshopru closed 3 years ago
Hello! Tell me how to use a socket to connect to a Redis, select a database other than 0 and set a password?
I didn't find anything useful in core code if (preg_match('/^redis=(.+)/',$dsn,$parts) && extension_loaded('redis')) { list($host,$port,$db,$password)=explode(':',$parts[1])+[1=>6379,2=>NULL,3=>NULL]; $this->ref=new Redis; if(!$this->ref->connect($host,$port,2)) $this->ref=NULL; if(!empty($password)) $this->ref->auth($password); if(isset($db)) $this->ref->select($db); }
if (preg_match('/^redis=(.+)/',$dsn,$parts) && extension_loaded('redis')) { list($host,$port,$db,$password)=explode(':',$parts[1])+[1=>6379,2=>NULL,3=>NULL]; $this->ref=new Redis; if(!$this->ref->connect($host,$port,2)) $this->ref=NULL; if(!empty($password)) $this->ref->auth($password); if(isset($db)) $this->ref->select($db); }
The question is closed.
It should be:
$f3->set('CACHE','redis=host:port:db:password');
Hello! Tell me how to use a socket to connect to a Redis, select a database other than 0 and set a password?
I didn't find anything useful in core code
if (preg_match('/^redis=(.+)/',$dsn,$parts) && extension_loaded('redis')) { list($host,$port,$db,$password)=explode(':',$parts[1])+[1=>6379,2=>NULL,3=>NULL]; $this->ref=new Redis; if(!$this->ref->connect($host,$port,2)) $this->ref=NULL; if(!empty($password)) $this->ref->auth($password); if(isset($db)) $this->ref->select($db); }