Skip to content

Commit a5b7299

Browse files
committed
Merge pull request #147 from vincent/final
Check if Predis is already loaded
2 parents fcbc798 + d3f3896 commit a5b7299

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

phpfastcache/3.0.0/drivers/predis.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,22 @@ class phpfastcache_predis extends BasePhpFastCache implements phpfastcache_drive
1616

1717
function checkdriver() {
1818
// Check memcache
19+
if (! class_exists("\\Predis\\Client")) {
1920
$this->required_extension("predis-1.0/autoload.php");
2021
try {
2122
Predis\Autoloader::register();
2223
} catch(Exception $e) {
2324

2425
}
25-
return true;
26+
}
27+
return true;
2628
}
2729

2830
function __construct($config = array()) {
2931
$this->setup($config);
32+
if (! class_exists("\\Predis\\Client")) {
3033
$this->required_extension("predis-1.0/autoload.php");
31-
32-
33-
34+
}
3435
}
3536

3637
function connectServer() {
@@ -164,4 +165,4 @@ function driver_isExisting($keyword) {
164165

165166

166167

167-
}
168+
}

0 commit comments

Comments
 (0)