PHP Connect Redis Database Simple Interest class
Redis = new Redis (); $this->redis->connect (Self::redishostname, Self::redisport, self::redistimeout); $this->redis->auth (Self::redispassword); $this->redis->select (self::redisdbname); }/** * Privatize clone function to prevent an out-of-Class clone object */Private Function __clone () {}/** * The only public static method of class, gets the unique entry for the class singleton * * @return Object */public static function Getredisinstance () {if (! (Self:: $instance instanceof Self)) {self:: $instance = new self (); } return Self:: $instance; /** * Get a connection instance of Redis * * @return Redis */Public Function Getredisconn () {return $th is->redis; /** * needs to be cleaned during a single switch */Public function __destruct () {self:: $instance->redis->close (); Self:: $instance = NULL; }}?>
http://www.bkjia.com/PHPjc/929776.html www.bkjia.com true http://www.bkjia.com/PHPjc/929776.html techarticle PHP Connect Redis Database simple Interest class Redis = new Redis (); $this->redis->connect (Self::redishostname, Self::redisport, self:: Redistimeout); $this->redis->auth (Self::redispassword); $t ...