mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
Test if class Memcached exists
This commit is contained in:
@@ -21,7 +21,11 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->memcache = new Memcache();
|
||||
if (class_exists('Memcached')) {
|
||||
$this->memcache = new Memcached();
|
||||
} else {
|
||||
$this->memcache = new Memcache();
|
||||
}
|
||||
$this->memcache->addServer('127.0.0.1', 11211);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user