mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
zip extension version 1.22.1
- add ZipArchive::FL_OPEN_FILE_NOW to open the file when added instead of waiting for archive to be closed
This commit is contained in:
parent
071bf46573
commit
b406f7c67a
6 changed files with 53 additions and 4 deletions
|
@ -299,7 +299,17 @@ static int php_zip_add_file(ze_zip_object *obj, const char *filename, size_t fil
|
|||
return -1;
|
||||
}
|
||||
|
||||
zs = zip_source_file(obj->za, resolved_path, offset_start, offset_len);
|
||||
if (flags & ZIP_FL_OPEN_FILE_NOW) {
|
||||
FILE *fd;
|
||||
fd = fopen(resolved_path, "rb");
|
||||
if (!fd) {
|
||||
return -1;
|
||||
}
|
||||
flags ^= ZIP_FL_OPEN_FILE_NOW;
|
||||
zs = zip_source_filep(obj->za, fd, offset_start, offset_len);
|
||||
} else {
|
||||
zs = zip_source_file(obj->za, resolved_path, offset_start, offset_len);
|
||||
}
|
||||
if (!zs) {
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue