PHP Connect Redis Database Simple Interest Class _php tutorial

Source: Internet
Author: User

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 ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.