mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Remove ifdef guards for ZIP_RDONLY (#21195)
ZIP_RDONLY was introduced in libzip 1.0.0 which is required since
a979e9f897
This commit is contained in:
@@ -1463,11 +1463,7 @@ PHP_METHOD(ZipArchive, open)
|
||||
}
|
||||
|
||||
/* open for write without option to empty the archive */
|
||||
#ifdef ZIP_RDONLY
|
||||
if ((flags & (ZIP_TRUNCATE | ZIP_RDONLY)) == 0) {
|
||||
#else
|
||||
if ((flags & ZIP_TRUNCATE) == 0) {
|
||||
#endif
|
||||
zend_stat_t st = {0};
|
||||
|
||||
/* exists and is empty */
|
||||
|
||||
@@ -82,12 +82,10 @@ class ZipArchive implements Countable
|
||||
* @cvalue ZIP_OVERWRITE
|
||||
*/
|
||||
public const int OVERWRITE = UNKNOWN;
|
||||
#ifdef ZIP_RDONLY
|
||||
/**
|
||||
* @cvalue ZIP_RDONLY
|
||||
*/
|
||||
public const int RDONLY = UNKNOWN;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @cvalue ZIP_FL_NOCASE
|
||||
|
||||
4
ext/zip/php_zip_arginfo.h
generated
4
ext/zip/php_zip_arginfo.h
generated
@@ -1,5 +1,5 @@
|
||||
/* This is a generated file, edit php_zip.stub.php instead.
|
||||
* Stub hash: 1f77735273373672b9c8c5b92c46e23ea99faeaf */
|
||||
* Stub hash: 030038017c7c76195c0b0dc2392696f458c2471f */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1)
|
||||
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
|
||||
@@ -550,14 +550,12 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry
|
||||
zend_string *const_OVERWRITE_name = zend_string_init_interned("OVERWRITE", sizeof("OVERWRITE") - 1, true);
|
||||
zend_declare_typed_class_constant(class_entry, const_OVERWRITE_name, &const_OVERWRITE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG));
|
||||
zend_string_release_ex(const_OVERWRITE_name, true);
|
||||
#if defined(ZIP_RDONLY)
|
||||
|
||||
zval const_RDONLY_value;
|
||||
ZVAL_LONG(&const_RDONLY_value, ZIP_RDONLY);
|
||||
zend_string *const_RDONLY_name = zend_string_init_interned("RDONLY", sizeof("RDONLY") - 1, true);
|
||||
zend_declare_typed_class_constant(class_entry, const_RDONLY_name, &const_RDONLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG));
|
||||
zend_string_release_ex(const_RDONLY_name, true);
|
||||
#endif
|
||||
|
||||
zval const_FL_NOCASE_value;
|
||||
ZVAL_LONG(&const_FL_NOCASE_value, ZIP_FL_NOCASE);
|
||||
|
||||
Reference in New Issue
Block a user