Test if class Memcached exists

This commit is contained in:
uwetews
2015-12-31 03:44:42 +01:00
parent 239fed38b9
commit 633a6285b0

View File

@@ -21,7 +21,11 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore
public function __construct() public function __construct()
{ {
if (class_exists('Memcached')) {
$this->memcache = new Memcached();
} else {
$this->memcache = new Memcache(); $this->memcache = new Memcache();
}
$this->memcache->addServer('127.0.0.1', 11211); $this->memcache->addServer('127.0.0.1', 11211);
} }