Memcached(不是memcache) PHP扩展在Windows上


Memcached (not memcache) PHP extension on Windows

我找不到MemcacheD PHP扩展

有几个php_memcache.dll的编译,但这是不一样的。

我缺少的主要内容是getMulti(),它不存在于Memcache中。

到目前为止,我找到了这个,但是没有DLL:

http://pecl.php.net/package/memcached

正式地说,它不存在。不过,也有一些人创建了自己的DLL。下面是一个人创建dll的博客:

http://trondn.blogspot.com/2010/07/libmemcached-on-win32.html

这里有一个链接到存储库的源代码,这样你就可以为memcached构建自己的DLL:

http://bazaar.launchpad.net/trond-norbye/libmemcached/mingw32/文件

我知道memcached还有其他一些特性,但它的接口几乎与memcache扩展相同。您可以很容易地摆脱这样的代码,在我的情况下,它工作得非常好。如果您没有加载memcached,则创建以下文件:

<>之前 <?php class Memcached { const OPT_LIBKETAMA_COMPATIBLE = true; const OPT_COMPRESSION = true; const OPT_NO_BLOCK = true; //if you code relies on any other constants define them to avoid //undefined constant notice //http://www.php.net/manual/en/memcached.constants.php public $_instance; public function __construct() { $this->_instance = new Memcache; } public function __call($name, $args) { return call_user_func_array(array($this->_instance, $name), $args); } public function setOption() {} } 之前

要么包含它,要么配置自动加载器来拾取它。当然,您需要一个正确配置的memcache实例和addServer调用,但是如果代码库假设使用Memcached,那么这些调用应该已经在代码中了。希望对大家有所帮助/