judge exist before call redis class

This commit is contained in:
Guobao Jiang 2014-03-06 20:58:39 +08:00
parent 4a4dfbc6d1
commit 16332292fa
1 changed files with 7 additions and 0 deletions

View File

@ -24,6 +24,13 @@ class iredis
public function __construct()
{
if (!extension_loaded('redis')) {
##echo "no load!";
if (!dl('redis.so')) {
exit;
}
}
$this->redis = new redis();
$this->redis->connect($this->redis_server, $this->redis_port);
## $this->redis->pconnect($this->redis_server, $this->redis_port);