Lines Matching defs:p_entry

3393     public function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
3407 // ----- Check that the file header is coherent with $p_entry info
3408 if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
3415 if (($p_entry['external'] & 0x00000010) == 0x00000010) {
3418 $p_entry['status'] = "filtered";
3425 $p_entry['filename'] = basename($p_entry['filename']);
3428 if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2) {
3429 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The folder is the same as the removed path '".$p_entry['filename']."'");
3432 $p_entry['status'] = "filtered";
3439 if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path) {
3440 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file '".$p_entry['filename']."'");
3443 $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size);
3445 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Resulting file is '".$p_entry['filename']."'");
3451 $p_entry['filename'] = $p_path . "/" . $p_entry['filename'];
3460 $p_entry['filename']
3467 "Filename '" . $p_entry['filename'] . "' is "
3482 $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
3490 $p_entry['status'] = "skipped";
3498 $p_entry['status'] = "aborted";
3504 $p_entry['filename'] = $v_local_header['filename'];
3505 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'");
3508 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'");
3511 if ($p_entry['status'] == 'ok') {
3513 if (file_exists($p_entry['filename'])) {
3514 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$p_entry['filename']."' already exists");
3517 if (is_dir($p_entry['filename'])) {
3518 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is a directory");
3520 $p_entry['status'] = "already_a_directory";
3532 "Filename '" . $p_entry['filename'] . "' is "
3539 } elseif (!is_writable($p_entry['filename'])) {
3540 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is write protected");
3542 $p_entry['status'] = "write_protected";
3554 "Filename '" . $p_entry['filename'] . "' exists "
3561 } elseif (filemtime($p_entry['filename']) > $p_entry['mtime']) {
3562 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is newer (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")");
3571 $p_entry['status'] = "newer_exist";
3584 "Newer version of '" . $p_entry['filename'] . "' exists "
3593 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is older than the extrated one - will be replaced by the extracted one (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")");
3599 if ((($p_entry['external'] & 0x00000010) == 0x00000010) || (substr($p_entry['filename'], -1) == '/')) {
3600 $v_dir_to_check = $p_entry['filename'];
3601 } elseif (!strstr($p_entry['filename'], "/")) {
3603 } else $v_dir_to_check = dirname($p_entry['filename']);
3605 if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external'] & 0x00000010) == 0x00000010))) != 1) {
3606 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to create path for '".$p_entry['filename']."'");
3609 $p_entry['status'] = "path_creation_fail";
3620 if ($p_entry['status'] == 'ok') {
3622 if (!(($p_entry['external'] & 0x00000010) == 0x00000010)) {
3624 if ($p_entry['compression'] == 0) {
3628 if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
3629 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode");
3632 $p_entry['status'] = "write_error";
3639 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read '".$p_entry['size']."' bytes");
3642 $v_size = $p_entry['compressed_size'];
3659 touch($p_entry['filename'], $p_entry['mtime']);
3661 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file (Compression method ".$p_entry['compression'].")");
3664 if (($p_entry['flag'] & 1) == 1) {
3672 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".($p_entry['compressed_size']-12)."' compressed & encrypted bytes");
3673 $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']-12);
3677 $p_entry['compressed_size']-12, $p_entry['crc']);
3681 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".$p_entry['compressed_size']."' compressed bytes");
3683 $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
3694 $p_entry['status'] = "error";
3701 if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
3702 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode");
3705 $p_entry['status'] = "write_error";
3712 @fwrite($v_dest_file, $v_file_content, $p_entry['size']);
3719 @touch($p_entry['filename'], $p_entry['mtime']);
3727 @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]);
3735 if ($p_entry['status'] == "aborted") {
3736 $p_entry['status'] = "skipped";
3745 $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
3771 public function privExtractFileInOutput(&$p_entry, &$p_options)
3784 // ----- Check that the file header is coherent with $p_entry info
3785 if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
3795 $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
3803 $p_entry['status'] = "skipped";
3811 $p_entry['status'] = "aborted";
3817 $p_entry['filename'] = $v_local_header['filename'];
3818 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'");
3822 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'");
3825 if ($p_entry['status'] == 'ok') {
3827 if (!(($p_entry['external'] & 0x00000010) == 0x00000010)) {
3829 if ($p_entry['compressed_size'] == $p_entry['size']) {
3831 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes");
3834 $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
3841 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Reading '".$p_entry['size']."' bytes");
3844 $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
3859 if ($p_entry['status'] == "aborted") {
3860 $p_entry['status'] = "skipped";
3869 $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
3894 public function privExtractFileAsString(&$p_entry, &$p_string)
3896 //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileAsString', "p_entry['filename']='".$p_entry['filename']."'");
3909 // ----- Check that the file header is coherent with $p_entry info
3910 if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
3914 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file in string (with path) '".$p_entry['filename']."', size '$v_header[size]'");
3917 if (!(($p_entry['external'] & 0x00000010) == 0x00000010)) {
3919 // if ($p_entry['compressed_size'] == $p_entry['size'])
3920 if ($p_entry['compression'] == 0) {
3922 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes");
3925 $p_string = @fread($this->zip_fd, $p_entry['compressed_size']);
3927 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file (compression method '".$p_entry['compression']."')");
3930 $v_data = @fread($this->zip_fd, $p_entry['compressed_size']);