From d3f3896fc74603c07339f4063818f6259a9debf1 Mon Sep 17 00:00:00 2001 From: Vincent Lark Date: Tue, 27 Oct 2015 22:35:45 +0100 Subject: [PATCH] check if Predis is already loaded --- phpfastcache/3.0.0/drivers/predis.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/phpfastcache/3.0.0/drivers/predis.php b/phpfastcache/3.0.0/drivers/predis.php index 491b963c5..3d5ef79d7 100644 --- a/phpfastcache/3.0.0/drivers/predis.php +++ b/phpfastcache/3.0.0/drivers/predis.php @@ -16,21 +16,22 @@ class phpfastcache_predis extends BasePhpFastCache implements phpfastcache_drive function checkdriver() { // Check memcache + if (! class_exists("\\Predis\\Client")) { $this->required_extension("predis-1.0/autoload.php"); try { Predis\Autoloader::register(); } catch(Exception $e) { } - return true; + } + return true; } function __construct($config = array()) { $this->setup($config); + if (! class_exists("\\Predis\\Client")) { $this->required_extension("predis-1.0/autoload.php"); - - - + } } function connectServer() { @@ -164,4 +165,4 @@ function driver_isExisting($keyword) { -} \ No newline at end of file +}