当然,仅仅包括在它的上面有this class文件:
<?php
// Dummy Memcache for a development environment where Memcache is not installed. Part of mmvc library, https://github.com/kajala/mmvc
// Dependencies: none
//if (defined('MEMCACHE_COMPRESSED'))
// die("Memcache seems to be already installed, MemcacheDummy.php should never be included in this case\n");
define('MEMCACHE_COMPRESSED', 1234); // dummy value
/**
* Dummy Memcache class for a development environment where Memcache is not installed.
* Note that this class does not do ANYTHING and it is only a convenience for
* the development environment and should never be used in production server.
*/
class Memcache
{
function __construct()
{
}
function connect($host, $port)
{
assert(is_string($host));
assert(is_numeric($port));
return true;
}
function set($key, $obj, $compressed=false, $expires=0)
{
assert(is_string($key));
assert($compressed === false || $compressed == MEMCACHE_COMPRESSED);
assert(is_numeric($expires));
return true;
}
function get($key)
{
assert(is_string($key) || is_array($key));
return false;
}
}
?>
注:该代码是不是我的,它是在BSD许可证下授权。原作者:link
我需要为生产环境这帮助我 – user2089985 2013-04-24 12:06:02
它会在生产环境中工作,但你应该只安装内存缓存。 – 2013-04-24 12:09:21
我没有机会安装memcache共享主机hostgator帐户,他告诉他们不能为共享主机提供memcache服务? – user2089985 2013-04-24 12:13:31