Commit graph

436 commits

Author SHA1 Message Date
Remi Collet
3af1cee884 add ZipArchive::registerProgressCallback and ZipArchive::registerCancelCallback methods 2020-01-31 09:06:42 +01:00
Remi Collet
272698d7fd Merge branch 'PHP-7.4'
* PHP-7.4:
  zip: more constants
2020-01-29 14:25:26 +01:00
Remi Collet
bdcfdd4402 zip: more constants 2020-01-29 14:25:16 +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
Remi Collet
a1d3f999c1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add ZipArchive::CM_LZMA2 constant (since libzip 1.6.0)
2020-01-24 14:06:38 +01:00
Remi Collet
b9dff1160e Add ZipArchive::CM_LZMA2 constant (since libzip 1.6.0) 2020-01-24 14:06:19 +01:00
Máté Kocsis
bbcfa66e06
Use RETURN_THROWS() after zend_fetch_resource*() 2020-01-03 19:20:56 +01:00
Nikita Popov
f23378d84a Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove unnecessary strncpy in zip
2020-01-03 12:03:31 +01:00
Nikita Popov
3e5675d730 Remove unnecessary strncpy in zip
This causes a warning on GCC 9 and is unnecessary to boot: We
only use "cwd" for the open_basedir check, so we can just as well
pass in the original string.
2020-01-03 11:53:03 +01:00
Máté Kocsis
12ce73a5bb
Use RETURN_THROWS() after zend_value_error() 2019-12-31 16:58:15 +01:00
Máté Kocsis
345703724c
Use RETURN_THROWS() during ZPP in most of the extensions
Except for some bigger ones: reflection, sodium, spl
2019-12-31 11:46:11 +01: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
Christoph M. Becker
3c16606d46 Elevate warning to ValueError for invalid ZipArchive object 2019-09-29 14:28:39 +02:00
Christoph M. Becker
61a4ae90d7 Add missing zend_parse_parameters_none() 2019-09-29 14:28:38 +02:00
Christoph M. Becker
1858b00d00 Add ZipArchive arginfo stubs 2019-09-29 14:28:37 +02:00
Christoph M. Becker
31e8ce6604 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix build for libzip < 0.11.2
2019-09-29 13:39:15 +02:00
Christoph M. Becker
ce769a94a8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix build for libzip < 0.11.2
2019-09-29 13:38:28 +02:00
Christoph M. Becker
466f91bb3b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix build for libzip < 0.11.2
2019-09-29 13:34:16 +02:00
Christoph M. Becker
f6bfbe9553 Fix build for libzip < 0.11.2
We must not define method entries, if the actual method definitions or
the arginfo structures are not defined.
2019-09-29 13:33:18 +02:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Remi Collet
8aab32ff5f Merge branch 'PHP-7.4'
* PHP-7.4:
  zip edxtension is now 1.15.5
  fix type consistency after 8f897f1040
2019-09-09 14:22:24 +02:00
Remi Collet
766d5ff32f fix type consistency after
8f897f1040
2019-09-09 14:20:57 +02:00
Christoph M. Becker
99c57b33cf Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace deprecated libzip functions
2019-08-26 14:06:08 +02:00
Christoph M. Becker
8f897f1040 Replace deprecated libzip functions
We replace all deprecated libzip functions with their recommended
substitutes, and add proper comment length checks including a test
case.
2019-08-26 14:05:28 +02:00
Christoph M. Becker
e7ac9428d8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove dead code
2019-08-13 13:29:35 +02:00
Christoph M. Becker
eb25176ab3 Remove dead code 2019-08-13 13:29:11 +02:00
Stephen Reay
d4e5e63b6c Added zip arginfo stubs 2019-08-13 13:01:51 +02:00
twosee
63171d88f2 Add do...while(0) for RETURN_* and ZVAL_* APIs
Closes GH-4255.
2019-06-12 16:17:16 +02:00
Nikita Popov
3820296c42 Merge branch 'PHP-7.4' 2019-06-06 11:48:54 +02:00
Nikita Popov
3372f2cf2c php_zip_pcre: Match pattern before stating for directories
For two reasons: First, it's generally cheaper to match a regex than
perform a stat (especially on Windows). Second, it will not fail on
concurrent modification of a directory in parts that are not matched
by the pattern, such as the spurious failure in ext/zip/tests/bug72660.phpt.
2019-06-06 11:46:23 +02:00
Dmitry Stogov
457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Dmitry Stogov
e188e4170f Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:28:29 +03:00
Dmitry Stogov
2e4686b566 Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:16:47 +03:00
Dmitry Stogov
34db07567d Use ZEND_TRA_ASSIGN_REF_... macros for by reference arguments of internal functions. 2019-04-24 16:14:48 +03:00
Gabriel Caruso
12446aafce Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove HAVE_* for always available extensions
2019-04-14 11:51:39 -03:00
Gabriel Caruso
656db96eb9 Remove HAVE_* for always available extensions 2019-04-14 11:44:12 -03:00
Christoph M. Becker
7ad6e1d7de Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove unused variables
2019-03-17 23:32:53 +01:00
Fabien Villepinte
b6f9ade9f2 Remove unused variables 2019-03-17 23:29:51 +01:00
Dmitry Stogov
91ef4124e5 Refactor zend_object_handlers API to pass zend_object* and zend_string* insted of zval(s). 2019-02-04 13:20:25 +03:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Nikita Popov
e219ec144e Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2019-01-11 15:49:06 +01:00
Nikita Popov
27e9c05e81 Remove preg_options param from pcre_get_compiled_regex()
This parameter is always zero and not necessary to call pcre2_match.

I'm leaving the parameter behind on the _ex() variant, so the preg_flags
are still accessible in some way.
2018-12-26 17:20:13 +01:00