cache_memcache.class.php

来自「Phpcms2008 是一款基于 PHP+Mysql 架构的网站内容管理系统」· PHP 代码 · 共 37 行

PHP
37
字号
<?php 
class cache
{
	var $memcache;

    function __construct()
    {
		$this->memcache = &new Memcache;
		$this->memcache->pconnect(MEMCACHE_HOST, MEMCACHE_PORT, MEMCACHE_TIMEOUT);
    }

    function cache()
    {
		$this->__construct();
    }

	function get($name)
    {
        return $this->memcache->get($name);
    }

    function set($name, $value, $ttl = 0)
    {
         return $this->memcache->set($name, $value, 0, $ttl);
    }

    function rm($name)
    {
        return $this->memcache->delete($name);
    }

    function clear()
    {
        return $this->memcache->flush();
    }
}
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?