1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 16:08:35 +02:00

139 Commits

Author SHA1 Message Date
Ben Ramsey 67347de763 license-update: ext/zip source headers
RFC: https://wiki.php.net/rfc/php_license_update
2026-04-11 21:20:54 -05:00
Tim Starling e0e2963b74 Wrap strings passed to libzip with zip_source_function_create() (#21659)
Wrap strings passed to libzip with zip_source_function_create()
instead of using zip_source_buffer_create(). This allows us to make
the string writable, and simplifies memory management.
2026-04-09 18:46:59 -07:00
Weilin Du 73c4690c0e [skip ci] Fix various typos in ext/zip (GH-21571) 2026-03-29 16:40:48 +02:00
Tim Starling 605c0756c9 ext/zip: add ZipArchive::openString() method
Fixes to GH-14078:

* Rename ZipArchive::openBuffer() to ::openString().
* For consistency with ::open(), return int|bool, don't throw an
  exception on error. Provide error information via existing properties
  and accessors.
* Fix memory leak when ::openString() is called but ::close() is not
  called. Add test.
* Fix memory leak when a call to ::open() is followed by a call to
  ::openString(). Add test.
* Let libzip own the source, don't call zip_source_keep().
* Share buffer handling with ZipArchive::addFromString().

Elsewhere:

* If there is an error from zip_close() during a call to
  ZipArchive::open(), emit a warning but proceed to open the archive,
  don't return early. Add test.
* When buffers are saved by ZipArchive::addFromString(), release them
  in ZipArchive::close() and ::open(), don't accumulate buffers until
  the free_obj handler is called.
* Factor out buffer handling and reuse it in ZipArchive::openString()

Closes GH-21205.
Closes GH-14078.

Co-authored-by: Soner Sayakci <s.sayakci@shopware.com>
Co-authored-by: Ghaith Olabi <24876890+Gaitholabi@users.noreply.github.com>
2026-03-14 15:03:36 +01:00
Remi Collet 806e0d0c03 Merge branch 'PHP-8.5'
* PHP-8.5:
  zip is now 1.22.8
2026-03-06 09:55:12 +01:00
Remi Collet 1d7cddd3ce Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  zip is now 1.22.8
2026-03-06 09:54:55 +01:00
Remi Collet fb80f35fdc zip is now 1.22.8 2026-03-06 09:54:32 +01:00
Niels Dossche 5bed2a8920 Avoid string copy in ZipArchive::addFromString() (#20497)
Instead of copying the data we increment the refcount of the string.
2025-11-16 14:57:00 +01:00
Remi Collet 8a1014128d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  zip is now 1.22.7
2025-09-25 12:19:39 +02:00
Remi Collet 6118c19ab8 zip is now 1.22.7 2025-09-25 12:19:27 +02:00
Remi Collet e3715cddf0 Merge branch 'PHP-8.4'
* PHP-8.4:
  bump zip extension version to 1.22.6
2025-05-07 14:24:22 +02:00
Remi Collet 71ffa9596a bump zip extension version to 1.22.6 2025-05-07 14:24:07 +02:00
Remi Collet c5ee870b85 Merge branch 'PHP-8.4'
* PHP-8.4:
  zip version is now 1.22.5
2025-02-20 11:48:09 +01:00
Remi Collet 04a33a1122 zip version is now 1.22.5 2025-02-20 11:47:51 +01:00
Gina Peter Banyard 79b9fe334a ext/zip: Convert cancel_callback to FCC 2025-01-17 16:48:28 +00:00
Gina Peter Banyard 76a5804560 ext/zip: Convert progress_callback to FCC 2025-01-17 16:48:28 +00:00
Niels Dossche fd0cabbbe4 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17139: Fix zip_entry_name() crash on invalid entry
2025-01-12 20:42:53 +01:00
Niels Dossche d08a9e0010 Fix GH-17139: Fix zip_entry_name() crash on invalid entry
Don't increment the refcount, but latter remember the ID to check
afterwards whether the resource still exists.

Replaces GH-17142.
Closes GH-17439.
2025-01-12 20:37:51 +01:00
Remi Collet a1cacec067 zip extension is 1.22.4 2024-09-26 09:39:10 +02:00
Remi Collet 3d5723e232 zip extension is 1.22.3 2023-11-14 15:58:18 +01:00
Remi Collet 94e26dc895 [ci skip] bump zip version 2023-08-23 18:01:20 +02:00
Remi Collet 0893b4bed5 add ZipArchive::LENGTH_TO_END and ZipArchive::LENGTH_UNCHECKED constants 2023-07-28 15:56:31 +02:00
Remi Collet b406f7c67a 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
2023-06-29 15:21:15 +02:00
Remi Collet b5638a1202 zip extension version 1.22.0 for libzip 1.10.0
- add new error macros (ER_DATA_LENGTH and ER_NOT_ALLOWED)
- add new archive global flags (ER_AFL_*)
- add ZipArchive::setArchiveFlag and ZipArchive::getArchiveFlag methods

New methods are available since libzip 0.11,
but really usable with new global flags
2023-06-26 16:39:22 +02:00
Máté Kocsis e4f2376919 Improve string class constant code generation (#9577)
Using strlen() will make sure that non-constant values can also be used.
2022-09-26 23:12:34 +02:00
Remi Collet ef4c20dea9 zip version bump to 1.21.1 2022-09-15 16:41:54 +02:00
Remi Collet 946cdb8ad1 remove LIBZIP_VERSION constant def from stub 2022-09-15 16:41:22 +02:00
Máté Kocsis 0c4c9fb93b Declare et/zip constants in stubs (#9146) 2022-08-16 10:18:24 +02:00
Remi Collet 2223853c58 implement fseek for zip stream when possible with libzip 1.9.1 2022-06-28 15:17:27 +02:00
Remi Collet 6672a5ecfe bump zip version 2022-05-02 15:18:02 +02:00
Remi Collet 105c2e0fcb bump zip ext version 2021-10-13 11:54:28 +02:00
Remi Collet e9b96ae5da Add ZipArchive::clearError, getStreamIndex and getStreamName methods
public function clearError(): void {}
    public function getStreamIndex(int $index, int $flags = 0) {}
    public function getStreamName(string $name, int $flags = 0) {}

ZipArchive::getStream is kept for BC

See https://github.com/pierrejoye/php_zip/issues/20
2021-10-11 15:39:35 +02:00
Remi Collet d515979b34 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  NEWS + bump zip version
  Fix #80833 ZipArchive::getStream doesn't use setPassword
2021-09-01 15:51:37 +02:00
Remi Collet fde24e4db0 NEWS + bump zip version 2021-09-01 15:51:24 +02:00
Remi Collet a6ffd8d1e9 Fix #80833 ZipArchive::getStream doesn't use setPassword 2021-09-01 15:49:46 +02:00
Remi Collet 6007bedac2 Merge branch 'PHP-8.0'
* PHP-8.0:
  zip extension is now 1.19.3
2021-06-07 12:10:10 +02:00
Remi Collet 1671996ed7 zip extension is now 1.19.3 2021-06-07 12:10:01 +02:00
KsaR 01b3fc03c3 Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Remi Collet ce18899b44 zip extension is 1.19.2 2020-11-23 15:59:15 +01:00
Remi Collet e39ce172f8 bump zip extension version 2020-09-29 16:17:23 +02:00
Remi Collet 42226fcf03 add ZipArchive::CM_XZ constant (in upcoming libzip 1.8.0) 2020-07-21 14:43:52 +02:00
Remi Collet a838cb5e11 bump zip version 2020-06-05 16:23:43 +02:00
Máté Kocsis 86d58e9fff Generate function entries for ext/zip
Closes GH-5601
2020-05-20 14:22:11 +02:00
Remi Collet d12b4c3c24 bump zip version 2020-03-20 14:08:57 +01:00
Remi Collet a5f136b855 bump zp to 1.18.1 + doc 2020-03-18 14:09:50 +01:00
Remi Collet 6f53605275 - make status, statusSys properties and
ZipArchive::getStatusString() method   available after archive is closed
2020-03-05 10:57:26 +01:00
Remi Collet 0b21a89472 add lastId property to ZipArchive 2020-03-04 15:31:06 +01:00
Remi Collet a6d86c9bba bump zip version + NEWS 2020-03-02 16:51:55 +01:00
Remi Collet c2a61c9d06 zip ext is now 1.17.1 2020-02-03 11:37:20 +01:00
Remi Collet b915d68852 Zip: version is now 1.17.0
change for Windows (which have libzip 1.4 by default)
update NEWS
2020-01-31 09:10:10 +01:00