close(); // } // }); } public function __destruct() { // if(isset($GLOBALS['redisdb'])){ // $redis = $GLOBALS['redisdb']; // $redis->close(); // } register_shutdown_function(function(){ if(isset($GLOBALS['redisdb'])){ $redis = $GLOBALS['redisdb']; $redis->close(); } }); } }