Here is my code:
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 () {return true; }/** * Destroy a session * @return Boolean * @since 5.4.0 */Public Function Destroy ($session _id) {$this->connect (); $this->redis->del ($session _id); return true; }/** * Cleanup old Sessions * @return Boolean * @since 5.4.0 */Public Function GC ($MAXLIFETIME) {return true; }/** * Initialize session * @since 5.4.0 */Public Function open ($save _path, $sessionName) { return true; }/** * Read session data * @return String * @since 5.4.0 */Public function Read ($session _id) {$this->connect (); if ($this->redis->exists ($session _id)) {$value = $this->redis->get ($session _id); Return $value? ($value): '; } else {$expire = Configure (' Ymf.Account.expire '); $this->redis->setex ($session _id, $expire, "); Return '; } return '; }/** * Write session Data * @return Boolean * @since 5.4.0 */Public Function Write ($session _id, $s Essiondata) {$this->connect (); File_put_contents (__dir__. '/.. /.. /write.log ', "write {$sessionData}\r\n", file_append); if ($this->redis->set ("Flf", "HFL")) {return true; } else {return false; } }}
Troubleshooting will only, find this $this->redis->set method particularly slow, what reason ....
Reply content:
Here is my code:
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 () {return true; }/** * Destroy a session * @return Boolean * @since 5.4.0 */Public Function Destroy ($session _id) {$this->connect (); $this->redis->del ($session _id); return true; }/** * Cleanup old Sessions * @return Boolean * @since 5.4.0 */Public Function GC ($MAXLIFETIME) {return true; }/** * Initialize session * @since 5.4.0 */Public Function open ($save _path, $sessionName) { return true; }/** * Read session data * @return String * @since 5.4.0 */Public function Read ($session _id) {$this->connect (); if ($this->redis->exists ($session _id)) {$value = $this->redis->get ($session _id); Return $value? ($value): '; } else {$expire = Configure (' Ymf.Account.expire '); $this->redis->setex ($session _id, $expire, "); Return '; } return '; }/** * Write session Data * @return Boolean * @since 5.4.0 */Public Function Write ($session _id, $s Essiondata) {$this->connect (); File_put_contents (__dir__. '/.. /.. /write.log ', "write {$sessionData}\r\n", file_append); if ($this->redis->set ("Flf", "HFL")) {return true; } else {return false; } }}
Troubleshooting will only, find this $this->redis->set method particularly slow, what reason ....