Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
simplify
  • Loading branch information
remicollet committed Jul 28, 2023
commit f37fc105e8ee74d8c4cf7054b6886bcbe337d1aa
5 changes: 5 additions & 0 deletions ext/zip/php_zip.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ extern zend_module_entry zip_module_entry;
#define ZIP_OVERWRITE ZIP_TRUNCATE
#endif

/* since 1.10.1 */
#ifndef ZIP_LENGTH_TO_END
#define ZIP_LENGTH_TO_END 0
#endif

/* Additionnal flags not from libzip */
#define ZIP_FL_OPEN_FILE_NOW (1u<<30)

Expand Down
9 changes: 1 addition & 8 deletions ext/zip/php_zip.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -720,19 +720,12 @@ class ZipArchive implements Countable
*/
public const LIBZIP_VERSION = UNKNOWN;

/* since 1.10.1 */
#ifdef ZIP_LENGTH_TO_END
/**
* @var int
* @cvalue ZIP_LENGTH_TO_END
*/
public const LENGTH_TO_END = UNKNOWN;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can now declare the constant types :) P.S.: Would you be OK to convert all ZipArchive class constants to typed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to not, as same code is also used for older PHP versions, and don't want to much diff.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, compat macro works, so done

Also in pecl pierrejoye/php_zip@f8abd19

#else
/**
* @var int
*/
public const LENGTH_TO_END = 0;
#endif
/* since 1.10.1 */
#ifdef ZIP_LENGTH_UNCHECKED
/**
* @var int
Expand Down
12 changes: 1 addition & 11 deletions ext/zip/php_zip_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.