Commit Graph

663 Commits

Author SHA1 Message Date
George Peter Banyard
1d0c287b90
Abort LMDB transaction whe trying to delete non-existing key 2022-07-01 17:28:36 +01:00
George Peter Banyard
8fce70ae7b
Abort LMDB transaction whe trying to delete non-existing key 2022-07-01 17:26:27 +01:00
Yurun
5cf2659fa5
Replace the use of ZVAL_BOOL() with ZVAL_TRUE() or ZVAL_FALSE() where the value is fixed (#8815) 2022-06-20 13:34:44 +01:00
George Peter Banyard
738adce79f Fix [-Wundef] warnings in DBA extension 2022-04-01 14:38:44 +01:00
George Peter Banyard
d71d0cf0bb Use zend_string for DBA first/next key handlers 2021-11-11 11:12:41 +00:00
George Peter Banyard
96ff88ec38 Use zend_string for DBA delete handler 2021-11-11 11:12:41 +00:00
George Peter Banyard
cd98e46583 Use zend_string for DBA exist handler 2021-11-11 11:12:41 +00:00
George Peter Banyard
0eb0f64455 Use zend_string for DBA update handler 2021-11-11 11:12:41 +00:00
George Peter Banyard
f8e15f1ed6 Use zend_string for DBA fetch handler 2021-11-11 11:12:41 +00:00
George Peter Banyard
c42336b8b8 Drop dba_lock.name element
This is unused
2021-11-11 11:12:41 +00:00
Máté Kocsis
fdf63bfef3
Merge branch 'PHP-8.1'
* PHP-8.1:
  Add more specific array return type hints for various extensions - part 1
2021-11-07 08:48:49 +01:00
Máté Kocsis
d02b9b953d
Add more specific array return type hints for various extensions - part 1
ext/bz2, ext/calendar, ext/dba, ext/enchant

Closes GH-7432
2021-11-07 08:46:25 +01:00
George Peter Banyard
7db32add9b
Refactor dba_(p)open() to be more sensible (#7610)
Actually use ZPP
Throw ValueErrors for invalid values
Use dedicated struc members for file permission and map size instead of a zval stack
2021-11-06 23:09:40 +00:00
George Peter Banyard
a6cc76eeb8
Remove XFAIL
This was fixed in PHP 7 according to https://bugs.php.net/bug.php?id=61390 (which the linked commit points to)
2021-11-06 20:50:07 +00:00
George Peter Banyard
8ca7220bc9
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix Bug #81588 TokyoCabinet driver leaks memory
2021-11-03 15:02:12 +00:00
George Peter Banyard
5a3774cac5
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix Bug #81588 TokyoCabinet driver leaks memory
2021-11-03 15:01:56 +00:00
George Peter Banyard
84524afb9e
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix Bug #81588 TokyoCabinet driver leaks memory
2021-11-03 15:01:41 +00:00
George Peter Banyard
9f77373b4e
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix Bug #81588 TokyoCabinet driver leaks memory
2021-11-03 14:58:11 +00:00
George Peter Banyard
96dd310c54
Fix Bug #81588 TokyoCabinet driver leaks memory 2021-11-03 14:57:47 +00:00
George Peter Banyard
927cdd0a39
Inline "helper" macros
They just make refactoring harder
2021-10-25 22:49:37 +01:00
George Peter Banyard
1086b22608
Use zend_result as return value for DBA handler 2021-10-25 22:49:37 +01:00
George Peter Banyard
8db5e70866
DBA should not convert elements in-place if the key param is an array
Also check that the value can actually be converted to string
2021-10-24 22:41:22 +01:00
George Peter Banyard
b50dc1e3a6
Fix DBA on MacOS (#7611)
The name zend_string* must be copied instead of returned directly in case the group part of the array is empty.
2021-10-23 20:53:11 +01:00
George Peter Banyard
e56c506020
Refactor DBA
Use proper ZPP union types
Use standard function signature semantics for dba_fetch()
Re-ordering of checks
2021-10-23 12:04:23 +01:00
George Peter Banyard
e21d02a62a
Drop confusing ac local variable for ZEND_NUM_ARGS() 2021-10-23 10:30:34 +01:00
George Peter Banyard
c6862d0ed5
Inline DBA_GET2 macro
It was used only twice
2021-10-23 10:30:34 +01:00
George Peter Banyard
29ef6523dd
Inline DBA_ID_PARS macro
It is used only 3 times and provides variable declarations which one shouldn't need to grep to see what is declared
2021-10-23 10:30:14 +01:00
George Peter Banyard
84e17d8f90
Inline DBA_GET2_3 macro
It is only used once
2021-10-23 10:18:26 +01:00
George Peter Banyard
b8327cff0b
Inline DBA_ID_GET2(_3) Macro 2021-10-23 10:13:57 +01:00
Nikita Popov
218fd03532 Fix some more CLEANUP sections 2021-09-03 14:10:40 +02:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
Nikita Popov
b5a14e6c04 Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
Nikita Popov
7485978339
Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00
Christoph M. Becker
2454e3b9a5
Merge branch 'PHP-8.0'
* PHP-8.0:
  Speed up ext/dba/tests/bug78808.phpt
2021-05-28 23:25:29 +02:00
Christoph M. Becker
af146a42ff
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Speed up ext/dba/tests/bug78808.phpt
2021-05-28 23:24:55 +02:00
Christoph M. Becker
c11b52de95
Speed up ext/dba/tests/bug78808.phpt
This tests takes about 2 minutes on AppVeyor CI, what is super slow.
The problem is that we're doing 50,000 inserts of small keys and values
instead of only few inserts with large values, what basically has the
same effect regarding the mmap size.

Closes GH-7073.
2021-05-28 23:24:18 +02:00
George Peter Banyard
c40231afbf
Mark various functions with void arguments.
This fixes a bunch of [-Wstrict-prototypes] warning,
because in C func() and func(void) have different semantics.
2021-05-12 14:55:53 +01: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
George Peter Banyard
5caaf40b43
Introduce pseudo-keyword ZEND_FALLTHROUGH
And use it instead of comments
2021-04-07 00:46:29 +01:00
Christoph M. Becker
0b2bb98af9 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80817: dba_popen() may cause segfault during RSHUTDOWN
2021-03-15 18:40:30 +01:00
Christoph M. Becker
eae69fcf71 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80817: dba_popen() may cause segfault during RSHUTDOWN
2021-03-15 18:39:26 +01:00
Christoph M. Becker
f448b0e6dd Fix #80817: dba_popen() may cause segfault during RSHUTDOWN
We need to close persistent streams with the proper flag.
2021-03-15 18:37:44 +01:00
Máté Kocsis
bf0f6aaf18
Improve class entry generation
Related to GH-6701
2021-02-16 13:09:56 +01:00
Nikita Popov
b10416a652 Deprecate passing null to non-nullable arg of internal function
This deprecates passing null to non-nullable scale arguments of
internal functions, with the eventual goal of making the behavior
consistent with userland functions, where null is never accepted
for non-nullable arguments.

This change is expected to cause quite a lot of fallout. In most
cases, calling code should be adjusted to avoid passing null. In
some cases, PHP should be adjusted to make some function arguments
nullable. I have already fixed a number of functions before landing
this, but feel free to file a bug if you encounter a function that
doesn't accept null, but probably should. (The rule of thumb for
this to be applicable is that the function must have special behavior
for 0 or "", which is distinct from the natural behavior of the
parameter.)

RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg

Closes GH-6475.
2021-02-11 21:46:13 +01:00
Máté Kocsis
99b08ac281
Implicitly enable function entry generation when class entry generation is enabled
Closes GH-6675
2021-02-09 13:37:24 +01:00
Máté Kocsis
5f21062054
Generate class entries for a few extensions
Relates to GH-6644
2021-02-03 09:24:09 +01:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Nikita Popov
422d1665a2 Make convert_to_*_ex simple aliases of convert_to_*
Historically, the _ex variants separated the zval first, if a
conversion was necessary. This distinction no longer makes sense
since PHP 7.

The only difference that was still left is that _ex checked whether
the type is the same first, but the usage of these macros did not
actually distinguish on whether such an inlined check is valuable
or not in a given context.

Also drop the unused convert_to_explicit_type macros.
2021-01-14 12:11:11 +01:00
Nikita Popov
97dd0eb98d Fix stub for dba_key_split()
This is an extremely weird function, but the behavior seems to be
intentional, and is quite clearly documented.

So we adjust the stub to also accept false|null as arguments. I
believe the implementation already correctly matches union type
semantics.
2020-10-22 14:50:52 +02:00
Nikita Popov
74d757e3fd Update ext/dba parameter names
Closes GH-6292.
2020-10-08 09:43:10 +02: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
Máté Kocsis
79981a394e
Add a bunch of missing argument types to stubs 2020-08-03 00:45:51 +02:00
Máté Kocsis
d30cd7d7e7
Review the usage of apostrophes in error messages
Closes GH-5590
2020-07-10 21:05:28 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
Fabien Villepinte
0c6d06ecfa Replace EXPECTF when possible
Closes GH-5779
2020-06-29 21:31:44 +02:00
Nikita Popov
c9b9f525a9 Include stub hash in generated arginfo files
The hash is used to check whether the arginfo file needs to be
regenerated. PHP-Parser will only be downloaded if this is actually
necessary.

This ensures that release artifacts will never try to regenerate
stubs and thus fetch PHP-Parser, as long as you do not modify any
files.

Closes GH-5739.
2020-06-24 09:55:19 +02:00
Nikita Popov
5794fbf5f8 Fix missing initializers in dba inifile 2020-06-23 12:41:10 +02:00
Máté Kocsis
6111d64cda
Improve a last couple of argument error messages
Closes GH-5404
2020-04-20 13:09:00 +02:00
Christoph M. Becker
175e5ed4bf Fix typo (UNKOWN -> UNKNOWN) 2020-04-09 14:06:11 +02:00
Máté Kocsis
3709e74b5e
Store default parameter values of internal functions in arg info
Closes GH-5353. From now on, PHP will have reflection information
about default values of parameters of internal functions.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-04-08 18:37:51 +02:00
Máté Kocsis
7c3078737f
Generate function entries from stubs for a couple of extensions
Closes GH-5347
2020-04-04 20:41:48 +02:00
Christoph M. Becker
7d0102dfa7 Revert "Replace @param annotations with type declarations"
This reverts commit c31029f335.
2020-02-17 08:55:18 +01:00
Christoph M. Becker
c31029f335 Replace @param annotations with type declarations 2020-02-16 23:43:38 +01:00
Nikita Popov
f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Máté Kocsis
99db00b1f2
Fix #78880 Another round 2020-01-19 18:28:43 +01:00
Máté Kocsis
aadd3aaed9
Use RETURN_THROWS() in various places 2020-01-03 21:10:24 +01:00
Máté Kocsis
bbcfa66e06
Use RETURN_THROWS() after zend_fetch_resource*() 2020-01-03 19:20:56 +01:00
Christoph M. Becker
bb3946a5e2 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78808: [LMDB] MDB_MAP_FULL: Environment mapsize limit reached
2020-01-03 18:51:25 +01:00
Christoph M. Becker
f4aa0869ac Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78808: [LMDB] MDB_MAP_FULL: Environment mapsize limit reached
2020-01-03 18:51:07 +01:00
Christoph M. Becker
c05a069adf Fix #78808: [LMDB] MDB_MAP_FULL: Environment mapsize limit reached
We implement support for a fifth parameter, which allows to specify the
mapsize.  The parameter defaults to zero, in which case the compiled in
default mapsize (usually 1048576) will be used.  The mapsize should be
a multiple of the page size of the OS.
2020-01-03 18:49:12 +01:00
Máté Kocsis
2f7309b1e9
Use RETURN_THROWS() during ZPP in the date, dba and dom extensions 2019-12-31 00:21:37 +01:00
Máté Kocsis
27e83d0fb8
Add union return types for function stubs 2019-11-11 14:54:55 +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
Máté Kocsis
9493893412 Cleanup return values when parameter parsing is unsuccessful 2019-10-30 16:05:20 +01:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Christoph M. Becker
72f73f95b5 Merge branch 'PHP-7.4'
* PHP-7.4:
  Allow lookup of distro-packaged QDBM headers on Debian
2019-09-23 09:54:59 +02:00
Stephen Reay
7a81505f6f Allow lookup of distro-packaged QDBM headers on Debian 2019-09-23 09:53:31 +02:00
Christoph M. Becker
071ccee7f7 Add ext/dba stubs 2019-09-22 13:58:30 +02:00
Nikita Popov
429378d78d Remove some misleading RETURN_FALSE
These functions throw, so they can't return false.

This is just a subset...
2019-08-12 10:05:36 +02:00
Peter Kokot
e0ea444dd3 Merge branch 'PHP-7.4'
* PHP-7.4:
  Convert all php_error_docref0 to php_error_docref
2019-07-13 02:10:17 +02:00
George Peter Banyard
1c1de0c41a Convert all php_error_docref0 to php_error_docref
Closes GH-4394
2019-07-13 02:05:17 +02:00
Nikita Popov
7686b0b889 Merge branch 'PHP-7.4' 2019-06-05 14:53:50 +02: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
Peter Kokot
2cf90bb2f0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Normalize comments in *nix build system m4 files
2019-05-12 18:51:50 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Peter Kokot
61d9e53ed9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove extension readmes
2019-03-19 20:26:07 +01:00
Peter Kokot
38b22448f8 Remove extension readmes
This patch removes several extension readmes in favor of the PHP manual
and where possible.
2019-03-19 20:25:32 +01:00
Peter Kokot
6426420f61 Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace dirname(__FILE__) by __DIR__ in tests
2019-03-15 23:36:47 +01:00
Fabien Villepinte
26dfce7f36 Replace dirname(__FILE__) by __DIR__ in tests 2019-03-15 22:55:30 +01:00
Dmitry Stogov
5f09db3073 Merge branch 'PHP-7.4'
* PHP-7.4:
  Switch to use ZTS cache
2019-03-12 14:17:14 +03:00
Dmitry Stogov
f1b306fe11 Switch to use ZTS cache 2019-03-12 14:15:47 +03:00
Nikita Popov
852485d8ec Adjust tests for zpp TypeError change 2019-03-11 11:32:20 +01:00
Peter Kokot
9df6a1e4dd Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01:00
Nikita Popov
caee56d709 Don't parallelize dba tests 2019-02-21 12:13:38 +01:00
Tyson Andre
9249d82019 Fix typos in code comments [skip ci] 2019-02-18 17:48:12 +01:00
Peter Kokot
c245898bfa Update and fix remaining year ranges (2019)
This patch follows previous license year ranges updates. With new
approach source code files now have simplified headers with license
information without year ranges.
2019-02-08 23:14:29 +01: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
Peter Kokot
782352c54a Trim trailing whitespace in *.phpt 2018-10-14 19:45:12 +02:00
Gabriel Caruso
9c144e0d82
Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00