Lines Matching refs:p_header
2502 function privAddFile($p_filedescr, &$p_header, &$p_options) argument
2532 $p_header['version'] = 20;
2533 $p_header['version_extracted'] = 10;
2534 $p_header['flag'] = 0;
2535 $p_header['compression'] = 0;
2536 $p_header['mtime'] = filemtime($p_filename);
2537 $p_header['crc'] = 0;
2538 $p_header['compressed_size'] = 0;
2539 $p_header['size'] = filesize($p_filename);
2540 $p_header['filename_len'] = strlen($p_filename);
2541 $p_header['extra_len'] = 0;
2542 $p_header['comment_len'] = 0;
2543 $p_header['disk'] = 0;
2544 $p_header['internal'] = 0;
2546 $p_header['external'] = (is_file($p_filename)?0x00000000:0x00000010);
2548 $p_header['offset'] = 0;
2549 $p_header['filename'] = $p_filename;
2550 $p_header['stored_filename'] = $v_stored_filename;
2551 $p_header['extra'] = '';
2552 $p_header['comment'] = '';
2553 $p_header['status'] = 'ok';
2554 $p_header['index'] = -1;
2562 $this->privConvertHeader2FileInfo($p_header, $v_local_header);
2570 $p_header['status'] = "skipped";
2576 if ($p_header['stored_filename'] != $v_local_header['stored_filename']) {
2577 $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']);
2583 if ($p_header['stored_filename'] == "") {
2584 $p_header['status'] = "filtered";
2588 if (strlen($p_header['stored_filename']) > 0xFF) {
2589 $p_header['status'] = 'filename_too_long';
2593 if ($p_header['status'] == 'ok') {
2609 $v_content_compressed = @fread($v_file, $p_header['size']);
2612 $p_header['crc'] = @crc32($v_content_compressed);
2615 $p_header['compressed_size'] = $p_header['size'];
2616 $p_header['compression'] = 0;
2621 $v_content = @fread($v_file, $p_header['size']);
2624 $p_header['crc'] = @crc32($v_content);
2630 $p_header['compressed_size'] = strlen($v_content_compressed);
2631 $p_header['compression'] = 8;
2658 if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
2666 $v_content_compressed, $p_header['compressed_size']);
2676 if (@substr($p_header['stored_filename'], -1) != '/') {
2677 $p_header['stored_filename'] .= '/';
2681 $p_header['size'] = 0;
2683 $p_header['external'] = 0x00000010; // Value for a folder : to be checked
2686 if (($v_result = $this->privWriteFileHeader($p_header)) != 1)
2700 $this->privConvertHeader2FileInfo($p_header, $v_local_header);
2844 function privWriteFileHeader(&$p_header) argument
2850 $p_header['offset'] = ftell($this->zip_fd);
2855 $v_date = getdate($p_header['mtime']);
2861 $p_header['version_extracted'], $p_header['flag'],
2862 $p_header['compression'], $v_mtime, $v_mdate,
2863 $p_header['crc'], $p_header['compressed_size'],
2864 $p_header['size'],
2865 strlen($p_header['stored_filename']),
2866 $p_header['extra_len']);
2872 if (strlen($p_header['stored_filename']) != 0)
2874 fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));
2876 if ($p_header['extra_len'] != 0)
2878 fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);
2893 function privWriteCentralFileHeader(&$p_header) argument
2905 $v_date = getdate($p_header['mtime']);
2911 $p_header['version'], $p_header['version_extracted'],
2912 $p_header['flag'], $p_header['compression'],
2913 $v_mtime, $v_mdate, $p_header['crc'],
2914 $p_header['compressed_size'], $p_header['size'],
2915 strlen($p_header['stored_filename']),
2916 $p_header['extra_len'], $p_header['comment_len'],
2917 $p_header['disk'], $p_header['internal'],
2918 $p_header['external'], $p_header['offset']);
2924 if (strlen($p_header['stored_filename']) != 0)
2926 fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));
2928 if ($p_header['extra_len'] != 0)
2930 fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);
2932 if ($p_header['comment_len'] != 0)
2934 fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']);
3077 function privConvertHeader2FileInfo($p_header, &$p_info) argument
3083 $p_info['filename'] = $p_header['filename'];
3084 $p_info['stored_filename'] = $p_header['stored_filename'];
3085 $p_info['size'] = $p_header['size'];
3086 $p_info['compressed_size'] = $p_header['compressed_size'];
3087 $p_info['mtime'] = $p_header['mtime'];
3088 $p_info['comment'] = $p_header['comment'];
3089 $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010);
3090 $p_info['index'] = $p_header['index'];
3091 $p_info['status'] = $p_header['status'];
4082 function privReadFileHeader(&$p_header) argument
4112 $p_header['filename'] = "";
4113 $p_header['status'] = "invalid_header";
4131 $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']);
4137 $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']);
4140 $p_header['extra'] = '';
4145 $p_header['version_extracted'] = $v_data['version'];
4147 $p_header['compression'] = $v_data['compression'];
4149 $p_header['size'] = $v_data['size'];
4151 $p_header['compressed_size'] = $v_data['compressed_size'];
4153 $p_header['crc'] = $v_data['crc'];
4155 $p_header['flag'] = $v_data['flag'];
4157 $p_header['filename_len'] = $v_data['filename_len'];
4161 $p_header['mdate'] = $v_data['mdate'];
4162 $p_header['mtime'] = $v_data['mtime'];
4163 if ($p_header['mdate'] && $p_header['mtime'])
4166 $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
4167 $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
4168 $v_seconde = ($p_header['mtime'] & 0x001F)*2;
4171 $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;
4172 $v_month = ($p_header['mdate'] & 0x01E0) >> 5;
4173 $v_day = $p_header['mdate'] & 0x001F;
4176 $p_header['mtime'] = mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);
4182 $p_header['mtime'] = time();
4192 $p_header['stored_filename'] = $p_header['filename'];
4195 $p_header['status'] = "ok";
4209 function privReadCentralFileHeader(&$p_header) argument
4239 $p_header['filename'] = "";
4240 $p_header['status'] = "invalid_header";
4254 …$p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_…
4258 if ($p_header['filename_len'] != 0)
4259 $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']);
4261 $p_header['filename'] = '';
4266 if ($p_header['extra_len'] != 0)
4267 $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']);
4269 $p_header['extra'] = '';
4274 if ($p_header['comment_len'] != 0)
4275 $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']);
4277 $p_header['comment'] = '';
4290 if ($p_header['mdate'] && $p_header['mtime'])
4293 $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
4294 $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
4295 $v_seconde = ($p_header['mtime'] & 0x001F)*2;
4298 $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;
4299 $v_month = ($p_header['mdate'] & 0x01E0) >> 5;
4300 $v_day = $p_header['mdate'] & 0x001F;
4303 $p_header['mtime'] = mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);
4309 $p_header['mtime'] = time();
4314 $p_header['stored_filename'] = $p_header['filename'];
4317 $p_header['status'] = 'ok';
4322 if (substr($p_header['filename'], -1) == '/') {
4324 $p_header['external'] = 0x00000010;