function PclZip::privExtractFileAsString in Loft Data Grids 7.2
Same name and namespace in other branches
- 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/PCLZip/pclzip.lib.php \PclZip::privExtractFileAsString()
1 call to PclZip::privExtractFileAsString()
- PclZip::privExtractByRule in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/PCLZip/pclzip.lib.php
File
- vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/PCLZip/pclzip.lib.php, line 4154
Class
- PclZip
Code
function privExtractFileAsString(&$p_entry, &$p_string, &$p_options) {
$v_result = 1;
$v_header = array();
if (($v_result = $this
->privReadFileHeader($v_header)) != 1) {
return $v_result;
}
if ($this
->privCheckFileHeaders($v_header, $p_entry) != 1) {
}
if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {
$v_local_header = array();
$this
->privConvertHeader2FileInfo($p_entry, $v_local_header);
$v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);
if ($v_result == 0) {
$p_entry['status'] = "skipped";
$v_result = 1;
}
if ($v_result == 2) {
$p_entry['status'] = "aborted";
$v_result = PCLZIP_ERR_USER_ABORTED;
}
$p_entry['filename'] = $v_local_header['filename'];
}
if ($p_entry['status'] == 'ok') {
if (!(($p_entry['external'] & 0x10) == 0x10)) {
if ($p_entry['compression'] == 0) {
$p_string = @fread($this->zip_fd, $p_entry['compressed_size']);
}
else {
$v_data = @fread($this->zip_fd, $p_entry['compressed_size']);
if (($p_string = @gzinflate($v_data)) === FALSE) {
}
}
}
else {
}
}
if ($p_entry['status'] == "aborted") {
$p_entry['status'] = "skipped";
}
elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
$v_local_header = array();
$this
->privConvertHeader2FileInfo($p_entry, $v_local_header);
$v_local_header['content'] = $p_string;
$p_string = '';
$v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);
$p_string = $v_local_header['content'];
unset($v_local_header['content']);
if ($v_result == 2) {
$v_result = PCLZIP_ERR_USER_ABORTED;
}
}
return $v_result;
}