From d8dd72fc31bf69c91fc778af77043ff5688e4e41 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 28 Jun 2023 14:27:57 +0200 Subject: [PATCH] The ZipArchive::FL_RECOMPRESS constant is deprecated --- ext/zip/php_zip.stub.php | 4 ++++ ext/zip/php_zip_arginfo.h | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ext/zip/php_zip.stub.php b/ext/zip/php_zip.stub.php index 070dbceffda..1ea4945876d 100644 --- a/ext/zip/php_zip.stub.php +++ b/ext/zip/php_zip.stub.php @@ -114,11 +114,15 @@ class ZipArchive implements Countable * @cvalue ZIP_FL_UNCHANGED */ public const FL_UNCHANGED = UNKNOWN; +/* deprecated in libzip 1.10.0 */ +#ifdef ZIP_FL_RECOMPRESS /** * @var int * @cvalue ZIP_FL_RECOMPRESS + * @deprecated */ public const FL_RECOMPRESS = UNKNOWN; +#endif /** * @var int * @cvalue ZIP_FL_ENCRYPTED diff --git a/ext/zip/php_zip_arginfo.h b/ext/zip/php_zip_arginfo.h index f9a904cdd89..156bdaf2ac7 100644 --- a/ext/zip/php_zip_arginfo.h +++ b/ext/zip/php_zip_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 28437141f4e401f2a50984e6eb3b5ee33e91e605 */ + * Stub hash: 65df723218ea5ca470163ebaf540ea5bde541824 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) @@ -563,12 +563,14 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zend_string *const_FL_UNCHANGED_name = zend_string_init_interned("FL_UNCHANGED", sizeof("FL_UNCHANGED") - 1, 1); zend_declare_class_constant_ex(class_entry, const_FL_UNCHANGED_name, &const_FL_UNCHANGED_value, ZEND_ACC_PUBLIC, NULL); zend_string_release(const_FL_UNCHANGED_name); +#if defined(ZIP_FL_RECOMPRESS) zval const_FL_RECOMPRESS_value; ZVAL_LONG(&const_FL_RECOMPRESS_value, ZIP_FL_RECOMPRESS); zend_string *const_FL_RECOMPRESS_name = zend_string_init_interned("FL_RECOMPRESS", sizeof("FL_RECOMPRESS") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_FL_RECOMPRESS_name, &const_FL_RECOMPRESS_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_class_constant_ex(class_entry, const_FL_RECOMPRESS_name, &const_FL_RECOMPRESS_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL); zend_string_release(const_FL_RECOMPRESS_name); +#endif zval const_FL_ENCRYPTED_value; ZVAL_LONG(&const_FL_ENCRYPTED_value, ZIP_FL_ENCRYPTED);