使用下面的代码,为call_user_func_array
添加session_set_save_handler
会导致每个页面在所有内容之后出现以下非描述性错误。 (超过我页面上的</html>
标记)。就像某种shutdown
/ destruct
方法导致它一样。
Fatal error: Exception thrown without a stack frame in Unknown on line 0
任何想法会导致什么?
session_set_cookie_params(0, "/", $pitchcare_settings['cookiehost'], False, False);
$Couchbase = new Couchbase($server_settings['couchbase']['host'], $server_settings['couchbase']['usename'], $server_settings['couchbase']['password'], $server_settings['couchbase']['bucket'], $server_settings['couchbase']['persistent']);
call_user_func_array('session_set_save_handler', array(
function($savePath, $name) use ($Couchbase) { // open
return true;
},
function() use ($Couchbase) { // close
return true;
},
function($key) use ($Couchbase) { // read
try {
return json_decode($Couchbase->get($key), true);
} catch (Exception $e) {
return false;
}
},
function($key, $data) use ($Couchbase) { // write
$Couchbase->delete($key);
return $Couchbase->add($key, json_encode($value), 10);
},
function($key = null) use ($Couchbase) { // destroy
return $Couchbase->delete($key);
},
function($maxlifetime) use ($Couchbase) { // gc
return true;
},
));
register_shutdown_function('session_write_close');
session_start();