have been using Memcache class, incredibly found there are memcached this class
Memcache extension
memcached extension
$mem = new memcache();// $mem = new memcached();
Reply content:
have been using Memcache class, incredibly found there are memcached this class
Memcache extension
memcached extension
$mem = new memcache();// $mem = new memcached();
The actual project will determine at the PHP code level which extension the operating environment has to call which
Most of the development environment is win, just use Memcache
Build environment mostly Linux, just use memcached
if (extension_loaded('memcached')) { $this->cache = new \Memcached; }else if(extension_loaded ('memcache')) $this->cache = new \Memcache; else{ $this->active = false; Log::error('Cache not support!'); return false; }
cc:http://segmentfault.com/q/1010000000513661
Memcached is a popular choice that works with many languages, including PHP.
However, to access a Memcached server from a PHP script, you have two different and named Stupid client library selections: Memcache and Memcached. They are two different libraries with almost identical names, both of which can be used to access a Memcached instance.
It turns out that the Memcached library has the best implementation of the Memcached protocol, contains some useful features that the Mmecache library does not have, and looks like the development of the Memcached library is also the most active.