Commit graph

225 commits

Author SHA1 Message Date
Christoph M. Becker
d65a520b1d Raise E_WARNING on PHP related errors
If Zip operations fails due to PHP error conditions before libzip even
has been called, there is no meaningful indication what failed; the
functions just return false, and the Zip status indicated that no error
did occur.  Therefore we raise `E_WARNING` in these cases.

Closes GH-6356.
2020-11-06 11:00:43 +01:00
Christoph M. Becker
f4b0b32e2d Raise E_WARNING on PHP related errors
If Zip operations fails due to PHP error conditions before libzip even
has been called, there is no meaningful indication what failed; the
functions just return false, and the Zip status indicated that no error
did occur.  Therefore we raise `E_WARNING` in these cases.

Closes GH-6356.
2020-10-26 11:40:06 +01:00
Nikita Popov
c5401854fc Run tidy
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00
George Peter Banyard
72383ccabb Promote warnings in ext/zip 2020-08-17 15:52:20 +02:00
Máté Kocsis
7aacc705d0
Add many missing closing PHP tags to tests
Closes GH-5958
2020-08-09 22:03:36 +02:00
Nikita Popov
0dda242bde Add GLOB_BRACE skipif 2020-08-06 10:26:32 +02:00
Fabien Villepinte
0c6d06ecfa Replace EXPECTF when possible
Closes GH-5779
2020-06-29 21:31:44 +02:00
Ayesh Karunaratne
d114812faf [ci skip] Various typo fixes in stub comments and CHANGES file 2020-06-25 23:32:40 +02:00
Máté Kocsis
f3b1f342c8
Deprecate the procedural API of ext/zip
Closes GH-5746
2020-06-23 17:39:29 +02:00
Remi Collet
b1fddec717 relax test (TS issue) 2020-05-18 07:53:03 +02:00
Rod Elias
682e2f6c20 Trim trailing whitespaces and fix code style
Closes GH-5554.
2020-05-12 17:00:11 +02:00
Remi Collet
2dc8d39bae - add ZipArchive::EM_UNKNOWN constant - add ZipArchive::EM_TRAD_PKWARE constant - cleanup hack for libzip 1.3.1 (have only exist for a few days) - add ZipArchive::isCompressionMethodSupported() method (libzip 1.7.0) - add ZipArchive::isEncryptionMethodSupported() method (libzip 1.7.0) - bump version to 1.19.0-dev 2020-04-02 14:52:05 +02:00
Remi Collet
57042ac23e add missing test 2020-03-20 12:13:25 +01:00
Remi Collet
db62ad18f3 fix test, thanks Indrek 2020-03-20 12:13:25 +01:00
Remi Collet
a4d12f46d1 ZipArchive::open(): Using empty file as ZipArchive is deprecated 2020-03-20 11:27:42 +01:00
Remi Collet
217ff8132e Merge branch 'PHP-7.4'
* PHP-7.4:
  unneeded after fix
  NEWS
  NEWS
  Fix Bug #79296 ZipArchive::open fails on empty file
2020-03-20 11:19:04 +01:00
Remi Collet
347d18b48e unneeded after fix 2020-03-20 11:18:52 +01:00
Remi Collet
3b22e10535 Fix bug #77960 add compr. /encr. options for ZipArchive::addGlob and ZipArchive::addPattern
options parameter now accepts:
- comp_method
- comp_flags
- enc_method
- enc_password
2020-03-18 14:05:09 +01:00
Remi Collet
be14d4e135 better fix for #72374 2020-03-06 10:27:29 +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
fb8e221907 - add ZipArchive::FL_RECOMPRESS, FL_ENCRYPTED, FL_OVERWRITE, FL_LOCAL, FL_CENTRAL constants
- add optional "flags" parameter to ZipArchive::addEmptyDir, addFile and addFromString methods
- add "flags" options to ZipArchive::addGlob and addPattern methods
  keeping previous behavior having FL_OVERWRITE by default
- add ZipArchive::replaceFile() method
2020-03-02 16:48:53 +01:00
Remi Collet
06750d75e9 Merge branch 'PHP-7.4'
* PHP-7.4:
  fix test
2020-02-28 10:39:43 +01:00
Remi Collet
5b82fd491a fix test 2020-02-28 10:39:08 +01:00
Remi Collet
7f0d3f1eab Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79315 ZipArchive::addFile doesn't honor start/length parameters
2020-02-28 10:35:39 +01:00
Remi Collet
d31fc591e0 Fix #79315 ZipArchive::addFile doesn't honor start/length parameters 2020-02-28 10:29:50 +01:00
Remi Collet
165d38a38d Merge branch 'PHP-7.4'
* PHP-7.4:
  NEWS
  Fix #79315 ZipArchive::addFile doesn't honor start/length parameters
2020-02-28 10:29:30 +01:00
Remi Collet
fb881cbdfc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79315 ZipArchive::addFile doesn't honor start/length parameters
2020-02-28 10:23:19 +01:00
Remi Collet
5b2d4c0ecc Fix #79315 ZipArchive::addFile doesn't honor start/length parameters 2020-02-28 10:21:19 +01:00
Dmitry Stogov
24127d2e3f Removed ext/zip/tests/oo_namelocate.zip 2020-02-07 16:52:26 +03:00
Nikita Popov
f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Remi Collet
4d80c3b7e0 Merge branch 'PHP-7.4'
* PHP-7.4:
  add test
  NEWS
  Fixed bug #73119 Wrong return for ZipArchive::addEmptyDir Method
2020-02-03 10:24:57 +01:00
Remi Collet
7fc06635c4 add test 2020-02-03 10:24:45 +01:00
Remi Collet
3c274613dc Fixed bug #73119 Wrong return for ZipArchive::addEmptyDir Method 2020-02-03 10:10:17 +01:00
Remi Collet
5eb9cffa14 Merge branch 'PHP-7.4'
* PHP-7.4:
  NEWS
  Fixed bug #73119 Wrong return for ZipArchive::addEmptyDir Method
2020-02-03 10:09:27 +01:00
Remi Collet
0bc19a4b81 Fixed bug #73119 Wrong return for ZipArchive::addEmptyDir Method 2020-02-03 10:08:09 +01:00
Remi Collet
3af1cee884 add ZipArchive::registerProgressCallback and ZipArchive::registerCancelCallback methods 2020-01-31 09:06:42 +01:00
Remi Collet
ac9a265f01 - bump zip extension version to 1.16.0 - add ZipArchive::setMtimeName and ZipArchive::setMtimeIndex methods 2020-01-28 10:53:49 +01:00
Remi Collet
cb1b26ac9c Merge branch 'PHP-7.4'
* PHP-7.4:
  - bump zip extension version to 1.15.6 - add ZipArchive::LIBZIP_VERSION - skip bug53885.phpt with libzip 1.6.0 (empty file is no more valid archive)
2020-01-27 16:48:54 +01:00
Remi Collet
5215f072af - bump zip extension version to 1.15.6
- add ZipArchive::LIBZIP_VERSION
- skip bug53885.phpt with libzip 1.6.0 (empty file is no more valid archive)
2020-01-27 16:47:28 +01:00
Máté Kocsis
d1764ca330
Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Máté Kocsis
0b4778c377
Fix #78880: Another bunch of spelling errors 2020-01-16 09:46:47 +01:00
Fabien Villepinte
a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00
Christoph M. Becker
f65d42d56c Merge branch 'PHP-7.4'
* PHP-7.4:
  Added missing call to ZipArchive::close()
2019-10-23 10:47:59 +02:00
Florian Engelhardt
1eae77221e Added missing call to ZipArchive::close() 2019-10-23 10:44:26 +02:00
Christoph M. Becker
e9be4622c8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78641: addGlob can modify given remove_path value
2019-10-08 09:50:43 +02:00
Christoph M. Becker
88e0d88897 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78641: addGlob can modify given remove_path value
2019-10-08 09:49:46 +02:00
Christoph M. Becker
11654fdfa6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78641: addGlob can modify given remove_path value
2019-10-08 09:48:59 +02:00
Christoph M. Becker
fd3118ffb0 Fix #78641: addGlob can modify given remove_path value
`remove_path` points to the given string, so we must not modify it.
Instead we use a duplicate, if we need the modification.

We may want to switch to `zend_string`s in master.
2019-10-08 09:45:05 +02:00
tyage
4d6f88e215 Fix #72374: remove_path strips first char of filename 2019-10-02 15:33:28 +02:00