2
Check for serialization handler
5
if (!extension_loaded('session')) {
6
exit('skip session extension not loaded');
10
phpinfo(INFO_MODULES);
11
$str = ob_get_clean();
13
$array = explode("\n", $str);
14
$array = preg_grep('/^igbinary session support.*yes/', $array);
16
exit('skip igbinary session handler not available');
25
function open($path, $name) {
36
return pack('H*', '0000000214011103666f6f0601');
39
function write($id, $data) {
42
$output .= substr(bin2hex($data), 8). "\n";
46
function destroy($id) {
60
ini_set('session.serialize_handler', 'igbinary');
62
session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc');
65
$db_object = new Foo();
66
$session_object = new Bar();
70
$_SESSION['test'] = "foobar";
72
session_write_close();
77
* you can add regression tests for your extension here
79
* the output of your test code has to be equal to the
80
* text in the --EXPECT-- section below for the tests
81
* to pass, differences between the output and the
82
* expected text are interpreted as failure
84
* see php5/README.TESTING for further information on
85
* writing regression tests
91
wrote: 14021103666f6f06011104746573741106666f6f626172