Lines Matching refs:header
29 $header = $this->ReadCentralFileHeaders($zip);
30 $header['index'] = $i;$info['filename'] = $header['filename'];
31 $info['stored_filename'] = $header['stored_filename'];
32 $info['size'] = $header['size'];$info['compressed_size']=$header['compressed_size'];
33 $info['crc'] = strtoupper(dechex( $header['crc'] ));
34 $info['mtime'] = $header['mtime']; $info['comment'] = $header['comment'];
35 $info['folder'] = ($header['external']==0x41FF0010||$header['external']==16)?1:0;
36 $info['index'] = $header['index'];$info['status'] = $header['status'];
37 $ret[]=$info; unset($header);
191 $header = $this->ReadCentralFileHeaders($zip);
192 $header['index'] = $i; $pos_entry = ftell($zip);
193 @rewind($zip); fseek($zip, $header['offset']);
195 $stat[$header['filename']]=$this->ExtractFile($header, $to, $zip);
202 function ReadFileHeader($zip, $header) argument
207 $header['filename'] = fread($zip, $data['filename_len']);
209 $header['extra'] = fread($zip, $data['extra_len']);
210 } else { $header['extra'] = ''; }
212 $header['compression'] = $data['compression'];
213 $header['flag'] = $data['flag'];
214 $header['mdate'] = $data['mdate'];$header['mtime'] = $data['mtime'];
215 …if (($header['flag'] & 8) != 8) { // Purpose bit flag bit 3 not set, overwrite the central header …
217 $header[$hd] = $data[$hd];
221 if ($header['mdate'] && $header['mtime']){
222 $hour=($header['mtime']&0xF800)>>11;$minute=($header['mtime']&0x07E0)>>5;
223 $seconde=($header['mtime']&0x001F)*2;$year=(($header['mdate']&0xFE00)>>9)+1980;
224 $month=($header['mdate']&0x01E0)>>5;$day=$header['mdate']&0x001F;
225 $header['mtime'] = mktime($hour, $minute, $seconde, $month, $day, $year);
226 }else{$header['mtime'] = time();}
228 $header['stored_filename'] = $header['filename'];
229 $header['status'] = "ok";
230 return $header;
235 …$header = unpack('vchkid/vid/vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vco…
237 if ($header['filename_len'] != 0)
238 $header['filename'] = fread($zip,$header['filename_len']);
239 else $header['filename'] = '';
241 if ($header['extra_len'] != 0)
242 $header['extra'] = fread($zip, $header['extra_len']);
243 else $header['extra'] = '';
245 if ($header['comment_len'] != 0)
246 $header['comment'] = fread($zip, $header['comment_len']);
247 else $header['comment'] = '';
249 if ($header['mdate'] && $header['mtime'])
251 $hour = ($header['mtime'] & 0xF800) >> 11;
252 $minute = ($header['mtime'] & 0x07E0) >> 5;
253 $seconde = ($header['mtime'] & 0x001F)*2;
254 $year = (($header['mdate'] & 0xFE00) >> 9) + 1980;
255 $month = ($header['mdate'] & 0x01E0) >> 5;
256 $day = $header['mdate'] & 0x001F;
257 $header['mtime'] = mktime($hour, $minute, $seconde, $month, $day, $year);
259 $header['mtime'] = time();
261 $header['stored_filename'] = $header['filename'];
262 $header['status'] = 'ok';
263 if (substr($header['filename'], -1) == '/')
264 $header['external'] = 0x41FF0010;
265 return $header;
296 function ExtractFile($header,$to,$zip) argument
298 $header = $this->readfileheader($zip, $header);
301 if(substr($header['filename'],-1)=="/")
304 $this->_mkdir($to.$header['filename']); //-- CS
314 if (!$this->_mkdir($to.dirname($header['filename']))) return (-1); //--CS
316 …if (!array_key_exists("external", $header) || (!($header['external']==0x41FF0010)&&!($header['exte…
318 if ($header['compression']==0)
320 $fp = @fopen($to.$header['filename'], 'wb');
322 $size = $header['compressed_size'];
333 touch($to.$header['filename'], $header['mtime']);
336 …if (!is_dir(dirname($to.$header['filename']))) $this->_mkdir(dirname($to.$header['filename'])); /…
337 $fp = fopen($to.$header['filename'].'.gz','wb');
339 $binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($header['compression']),
343 $size = $header['compressed_size'];
354 $binary_data = pack('VV', $header['crc'], $header['size']);
357 $gzp = @gzopen($to.$header['filename'].'.gz','rb');
359 @gzclose($gzp); @unlink($to.$header['filename']);
362 $fp = @fopen($to.$header['filename'],'wb');
364 $size = $header['size'];
376 touch($to.$header['filename'], $header['mtime']);
377 @unlink($to.$header['filename'].'.gz');