Update PHP Extension

This commit is contained in:
advect 2010-07-17 18:46:28 +09:00
parent a97f9081a3
commit 78f542f6c0
71 changed files with 7345 additions and 2108 deletions

9
php/test_streaming.php Executable file → Normal file
View file

@ -4,8 +4,7 @@
$msgs = array(pack("C*", 0x93, 0x01, 0x02, 0x03, 0x92), pack("C*", 0x03, 0x09, 0x04));
// streaming deserialize
$unpacker = new MessagePack();
$unpacker->initialize();
$unpacker = new MessagePackUnpacker();
$buffer = "";
$nread = 0;
@ -13,13 +12,11 @@
$buffer = $buffer . $msg;
while(true){
$nread = $unpacker->execute($buffer, $nread);
if($unpacker->finished()){
if($unpacker->execute($buffer, $nread)){
$msg = $unpacker->data();
var_dump($msg);
$unpacker->initialize();
$unpacker->reset();
$buffer = substr($buffer, $nread);
$nread = 0;