mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +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()
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user