Redis) {$cfg = [' scheme ' = + env (' Redis_scheme ', ' TCP '), ' host ' = env (' RE Dis_host ', ' 127.0.0.1 '), ' port ' = env (' Redis_port ', 6379)]; $this->redis = new \predis\client ($CFG); }}/** * Close the session * @since 5.4.0 */Public Function Close () {$this->redis-> ; Quit (); return true; }/** * Destroy a session * @since 5.4.0 */Public Function Destroy ($session _id) {$this->c Onnect (); return $this->redis->del ($session _id); }/** * Cleanup old sessions * @since 5.4.0 */Public Function GC ($MAXLIFETIME) {return true; }/** * Initialize session * @since 5.4.0 */Public Function open ($save _path, $session _id) { return true; }/** * Read session data * @since 5.4.0 */Public Function Read ($session _id) {$this->conNect (); return $this->redis->get ($session _id); }/** * Write session data * @since 5.4.0 */Public Function Write ($session _id, $session _data) { $this->connect (); $expire = Configure (' Ymf.Account.expire '); if (Is_int ($expire) && $expire > 0) {$result = $this->redis->setex ($session _id, $expire, $sess Ion_data); $re = $result? ' True ': ' false '; }else{$result = $this->redis->set ($session _id, $session _data); $re = $result? ' True ': ' false '; } return $re; }}
This is my code, how to debug what went wrong
Reply content:
Redis) {$cfg = [' scheme ' = + env (' Redis_scheme ', ' TCP '), ' host ' = env (' RE Dis_host ', ' 127.0.0.1 '), ' port ' = env (' Redis_port ', 6379)]; $this->redis = new \predis\client ($CFG); }}/** * Close the session * @since 5.4.0 */Public Function Close () {$this->redis-> ; Quit (); return true; }/** * Destroy a session * @since 5.4.0 */Public Function Destroy ($session _id) {$this->c Onnect (); return $this->redis->del ($session _id); }/** * Cleanup old sessions * @since 5.4.0 */Public Function GC ($MAXLIFETIME) {return true; }/** * Initialize session * @since 5.4.0 */Public Function open ($save _path, $session _id) { return true; }/** * Read session data * @since 5.4.0 */Public Function Read ($session _id) {$this->conNect (); return $this->redis->get ($session _id); }/** * Write session data * @since 5.4.0 */Public Function Write ($session _id, $session _data) { $this->connect (); $expire = Configure (' Ymf.Account.expire '); if (Is_int ($expire) && $expire > 0) {$result = $this->redis->setex ($session _id, $expire, $sess Ion_data); $re = $result? ' True ': ' false '; }else{$result = $this->redis->set ($session _id, $session _data); $re = $result? ' True ': ' false '; } return $re; }}
This is my code, how to debug what went wrong