3 require_once dirname(__FILE__) .
'/BayEOSBinaryTypes.php';
6 die(
"Usage: dumpImporter.php BAYEOS.DB.File url name pw timeoffset\n");
8 if(! is_readable($argv[1]))
9 die(
"File $argv[1] not readable\n");
11 $data=
"sender=$argv[3]&password=$argv[4]";
14 $fp=fopen($argv[1],
"r");
15 if(! isset($argv[5]) ) $argv[5]=0;
22 $length_bin=fread(
$fp,1);
24 if($length) $bayeosframe=fread(
$fp,$length);
27 $bayeosframe=pack(
"C",0x9).$ts_bin.$bayeosframe;
28 $frames.=
"&bayeosframes[]=".base64_encode($bayeosframe);
47 while(!
$fp = fsockopen(
$url, 8090)){
52 fputs(
$fp,
"POST / HTTP/1.1\r\n");
53 fputs(
$fp,
"Content-type: application/x-www-form-urlencoded\r\n");
54 fputs(
$fp,
"User-Agent: PHP-Importer\r\n");
55 fputs(
$fp,
"Content-length: ". strlen(
$data) .
"\r\n");
56 fputs(
$fp,
"Connection: close\r\n\r\n");
63 $res=rtrim(fgets(
$fp, 128));
64 if(strlen($res)==0) $header=0;
66 if(! $header) echo $res.
"\n";
while(!feof($fp)) if(strlen($frames)>0) send($url, $data)
static UINT32($value, $endianness=0)
static unpackUINT32($value, $endianness=0)
static unpackUINT8($value)