35 require_once
'PEAR.php';
100 $this->_byte_order =
'';
102 $this->_datasize = 0;
103 $this->_limit = 2080;
104 $this->_tmp_dir =
'';
118 $teststr = pack(
"d", 1.2345);
119 $number = pack(
"C8", 0x8D, 0x97, 0x6E, 0x12, 0x83, 0xC0, 0xF3, 0x3F);
120 if ($number == $teststr) {
122 } elseif ($number == strrev($teststr)){
126 return $this->
raiseError(
"Required floating point format ".
127 "not supported on this platform.");
129 $this->_byte_order = $byte_order;
140 if (strlen($data) > $this->_limit) {
143 $this->_data = $data.$this->_data;
144 $this->_datasize += strlen($data);
155 if (strlen($data) > $this->_limit) {
158 $this->_data = $this->_data.$data;
159 $this->_datasize += strlen($data);
176 if ($this->_BIFF_version == 0x0500) {
181 } elseif ($this->_BIFF_version == 0x0600) {
183 $unknown = pack(
"VV", 0x00000041, 0x00000006);
189 $header = pack(
"vv", $record, $length);
190 $data = pack(
"vvvv", $version, $type, $build, $year);
191 $this->
_prepend($header . $data . $unknown);
203 $header = pack(
"vv", $record, $length);
226 $tmp = substr($data, 0, 2).pack(
"v", $limit-4).substr($data, 4, $limit - 4);
228 $header = pack(
"vv", $record, $limit);
231 $data_length = strlen($data);
232 for ($i = $limit; $i < ($data_length - $limit); $i += $limit) {
234 $tmp .= substr($data, $i, $limit);
238 $header = pack(
"vv", $record, strlen($data) - $i);
240 $tmp .= substr($data, $i, strlen($data) - $i);
255 $this->_tmp_dir = $dir;