Commit Graph

1606 Commits

Author SHA1 Message Date
Jorg Adam Sowa
c4d9a37e81
Typed constants in date extension (#12361) 2024-05-22 13:17:44 +02:00
Tim Düsterhus
8094bd1b58
Make ReflectionGenerator::getFunction() legal after generator termination (#14167)
* Make `ReflectionGenerator::getFunction()` legal after generator termination

* Expose the generator function name via `Generator::__debugInfo()`

* Allow creating `ReflectionGenerator` after termination

* Reorder `struct _zend_generator` to avoid a hole

* Adjust `ext/reflection/tests/028.phpt`

This is legal now.

* Fix Generator Closure collection

* Add test to verify the Closure dies with the generator

* NEWS / UPGRADING
2024-05-21 08:54:51 +02:00
Niels Dossche
90e0ce7f0d
Throw early when a non-stream-context resource is passed to libxml_set_streams_context() (#14279) 2024-05-20 16:56:38 +02:00
David Carlier
9aa3a0d702
ext/pgsql: adding pg_change_password functionality.
handy call to change an user password while taking care transparently
of the password's encryption.

close GH-14262
2024-05-20 12:57:37 +01:00
武田 憲太郎
b7dd3d8347
ext/pdo_pgsql: Retrieve the memory usage of the query result resource (#14260)
`getAttribute()` can now retrieve the memory usage of query results.
`PDO::PGSQL_ATTR_RESULT_MEMORY_SIZE` was added for this feature.

closes #14260
2024-05-20 09:08:54 +09:00
武田 憲太郎
77fa4c0fce
ext/pgsql: add pg_result_memory_size
Close GH-14214
2024-05-13 22:58:02 +01:00
Niels Dossche
aa3e6eec50
Optimize and reduce memory usage of XML serialization (#14204)
The serialization process uses the system allocator and requires a copy
to request allocated memory once finished. This patch improves this by
using smart_str to build the resulting string, reducing the number of
copies and reducing total peak memory usage.
2024-05-12 01:57:29 +02:00
Niels Dossche
2956f55d17
[ci skip] UPGRADING: Update capitalization of Dom namespace 2024-05-09 12:47:39 +02:00
Niels Dossche
25860ee670
[ci skip] UPGRADING: Expand upon BCMath performance improvements 2024-05-09 12:46:42 +02:00
Máté Kocsis
920591064e Migrate SOAP table resource to array
Related to https://wiki.php.net/rfc/resource_to_object_conversion and https://github.com/php/php-tasks/issues/6
2024-05-08 22:48:19 +02:00
Máté Kocsis
60336de2ba Migrate SOAP SDL resource to object
Related to https://wiki.php.net/rfc/resource_to_object_conversion and https://github.com/php/php-tasks/issues/6
Closes GH-14121
2024-05-07 09:21:39 +02:00
Máté Kocsis
44b3cb2a13 Migrate SOAP URL resource to object
Related to https://wiki.php.net/rfc/resource_to_object_conversion and https://github.com/php/php-tasks/issues/6
2024-05-07 09:21:39 +02:00
Niels Dossche
f97bd071d5
Implement SeekableIterator for SplObjectStorage (#13665) 2024-05-05 13:26:54 +02:00
Niels Dossche
b1bb9c34e8
[ci skip] NEWS and UPGRADING 2024-05-01 16:57:36 +02:00
Saki Takamachi
10ae87969e
NEWS/UPGRADING 2024-05-01 22:02:43 +09:00
Tim Düsterhus
b5ffac7f6a
Add ReflectionClassConstant::isDeprecated() (#14086)
This is in preparation for php/php-src#11293 and for consistency with
ReflectionConstant::isDeprecated() that was added in php/php-src#13669.
2024-04-30 17:26:27 +02:00
Ilija Tovilo
cb55588a7e
Skip online tests by default
Fixes GH-14058
Closes GH-14070
2024-04-30 14:10:46 +02:00
David Carlier
1cf4cc3894
ext/intl: IntlDateFormatter::parseToCalendar addition.
Unlike IntlDateFormatter::parse, the timezone is updated
accordingly.

Close GH-13779
2024-04-29 18:55:00 +01:00
Máté Kocsis
afd91fb9ac
Migrate ext/odbc resources to opaque objects (#12040)
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2024-04-28 15:45:56 +02:00
David CARLIER
d5d227a43a
[ci skip] ext/sockets: followup on #14065. (#14066)
freebsd supports SO_NOSIGPIPE too.
2024-04-28 13:01:49 +01:00
David Carlier
b147a22bb8
ext/sockets: adding SO_NOSIGPIPE constant.
it s the macOs way to disable the SIGPIPE signal emission, same
 as doing `signal(SIGPIPE, SIG_IGN)` but on the socket level.

Close GH-14065
2024-04-28 12:01:03 +01:00
Gina Peter Banyard
f68d72527a UPGRADING 2024-04-24 15:39:47 +01:00
Niels Dossche
a70786304b
[ci skip] UPGRADING 2024-04-24 09:10:13 +02:00
Arnaud Le Blanc
6d285e3d08
[ci skip] UPGRADING 2024-04-23 11:58:51 +02:00
David Carlier
3a300e9213
ext/pcntl: signals list update for dragonflybsd related to checkpoint.
- SIGCKPT checkpoint and continue.
- SIGCKPTEXIT checkpoint and exit.

Close GH-14011
2024-04-22 21:21:52 +01:00
Laurent Arnoud
3f0b204f5a
cli: allow to change ~/.php_history with PHP_HISTFILE
Closes GH-13313
2024-04-22 10:05:47 +02:00
Niels Dossche
7428a92c5b
[ci skip] Be more specific about ext-dom incompatibilities in UPGRADING (#14024)
The previous text was put there before I decided to add the new classes.
Therefore the only new feature that can affect BC is
compareDocumentPosition(). Only when the declaration is incompatible can
the user experience errors.
2024-04-20 23:21:40 +02:00
Ilija Tovilo
e23440e5a6
Implement reflection constant
Fixes GH-13570
Closes GH-13669
2024-04-17 22:53:09 +02:00
David Carlier
d40726670f
ext/pcntl: pcntl_getqos_class/pcntl_setqos_class addition.
Introducting macOs Quality Of Service through those two calls.
on macOs arm64/M*, there is no concept of individual cores, thus
the old thread policy for cpu affinity does not work here.
Instead, the user can apply to the current process the level of
 performance/energy consumption they wish from the highest
QosClass::UserInteractive to QosClass::Background.

Close GH-13945
2024-04-15 18:52:28 +01:00
Niels Dossche
6df8111a8d
[ci skip] UPGRADING
Reorganize performance section.
Add performance entry for GH-13041.
2024-04-14 13:59:47 +02:00
Tim Düsterhus
08b2ab22f4
Include the source location in Closure names (#13550)
* Include the source location in Closure names

This change makes stack traces involving Closures, especially multiple
different Closures, much more useful, because it's more easily visible *which*
closure was called for a given stack frame.

The implementation is similar to that of anonymous classes which already
include the file name and line number within their generated classname.

* Update scripts/dev/bless_tests.php for closure naming

* Adjust existing tests for closure naming

* Adjust tests for closure naming that were not caught locally

* Drop the namespace from closure names

This is redundant with the included filename.

* Include filename and line number as separate keys in Closure debug info

* Fix test

* Fix test

* Include the surrounding class and function name in closure names

* Fix test

* Relax test expecations

* Fix tests after merge

* NEWS / UPGRADING
2024-04-12 18:21:13 +02:00
Máté Kocsis
843946a867
Add upgrading note for the "Dedicated StreamBucket class" RFC
[skip-ci]
2024-04-11 20:16:54 +02:00
Máté Kocsis
4a0ec3de46
Make ext/odbc default value handling more consistent (#13910)
These changes are carved off from https://github.com/php/php-src/pull/12040/files. I noticed that there are some inconsistencies between odbc_fetch_object()/odbc_fetch_array(), odbc_fetch_into(), as well as odbc_fetch_row(), specifically in how they handle the $row parameter. Now, I tried to align their behaviour the following way:

- I made null the default value. Previously, the default values were one of the following: -1, -1, 0, and null, respectively.
- odbc_fetch_row() has been returning false indicating there is no more rows when 0 is passed as $row. Now, a warning is also emitted in this case, because the null default value is not new, because it's available since PHP 8.0.
- When HAVE_SQL_EXTENDED_FETCH is not defined, the $row parameter is always ignored. Previously, some of the functions didn't accept it at all. Now a warning is emitted if the feature is not supported, but the parameter has any meaningful value (is greater than or equal to 1).
2024-04-10 22:49:41 +02:00
David Carlier
0e16e29b40
ext/sockets: socket_create_listen update.
going from 128 to system's SOMAXCONN by default to be able to increase
the queue of connections to be handled.
Also, for Haiku SOMAXCONN is only 32.

Close GH-13854
2024-04-10 18:39:38 +01:00
Yuya Hamada
44e8301cf6
Add grapheme_str_split function
I noticed that PHP does not have a grapheme cluster based str_split function.
So I created the grapheme_str_split function.

This feature will allow you to correctly handle emoji
and variable selectors.

Co-authored-by: Ayesh Karunaratne <Ayesh@users.noreply.github.com>

Close GH-13580
2024-04-10 18:20:23 +01:00
Saki Takamachi
fc14f17a20
remove ZWSP 2024-04-10 10:02:24 +09:00
David Carlier
645af9fb17
ext/sockets: adding solaris/illumos SO_EXCLBIND constant.
when set to "true", neutralises the effect of SO_REUSEADDR/SO_REUSEPORT
making the socket binding exclusive.

Close GH-13912
2024-04-09 21:41:22 +01:00
David Carlier
db2869346c
ext/posix: posix_isatty set errno for it too.
Close GH-13918
2024-04-09 17:34:03 +01:00
David Carlier
d8f2900574
ext/pcntl: adding pcntl_getcpu.
using sched_getcpu under the hood (Linux and FreeBSD).
Returns the current cpu id for the current process.
For Linux, we need to see beyond the sole presence of the symbol
to consider it.
Mostly useful, for now, in the cpu affinity context since
the os can migrate processes as it sees fits otherwise.

Clos GH-13908
2024-04-07 20:05:03 +01:00
David Carlier
1cf8291c85
ext/pcntl: cpu affinity api introduction.
For now, working on Linux, FreeBSD >= 13.x and DragonFlyBSD.
Handy wrapper to assign an array of cpu ids or to retrieve the cpu ids
assigned to a given process.

pcntl_setaffinity inserts valid unique cpu ids (within the range of available
cpus).

Close GH-13893
2024-04-07 00:56:54 +01:00
David Carlier
ae4978a139
ext/pcntl: adding pcntl_setns for Linux >= 5.3
allows a given process to join an existing Linux namespace, relatively
complementary to the existing pcntl_unshare.

Close GH-13878
2024-04-04 18:45:15 +01:00
Niels Dossche
30885f3b5f
Implement request #71571: XSLT processor should provide option to change maxDepth (#13731)
There are two depth limiting parameters for XSLT templates.
1) maxTemplateDepth
   This corresponds to the recursion depth of a template. For very
   complicated templates this can be hit.
2) maxTemplateVars
   This is the total number of live variables. When using recursive
   templates with lots of parameters you can hit this limit.

This patch introduces two new properties to XSLTProcessor that
corresponds to the above variables.
2024-03-31 21:21:23 +02:00
David Carlier
b82024b13c ext/sockets: adding Linux's TCP_SYNCNT constant.
Useful to control how many SYN packets the client will send to the
server before giving up establishing a connection if the server does
not respond (usually 5 or 6 by default).

Close GH-13816
2024-03-29 14:52:53 +00:00
Remi Collet
6c5814dade
revert base64_encode change 2024-03-27 08:08:43 +01:00
Remi Collet
dd6e738fe4
[ci skip] NEWS for base64_encode 2024-03-26 13:50:31 +01:00
Ayesh Karunaratne
3de3e137bf ext/openssl: Bump minimum required OpenSSL version to 1.1.1
Bumps the minimum required OpenSSL version from 1.0.2 to 1.1.1.

OpenSSL 1.1.1 is an LTS release, but has reached[^1] EOL from upstream. However, Linux distro/OS vendors
continue to ship OpenSSL 1.1.1, so 1.1.1 was picked as the minimum. The current minimum 1.0.2 reached
EOL in 2018.

Bumping the minimum required OpenSSL version makes it possible for ext-openssl to remove a bunch of
conditional code, and assume that TLS 1.3 (shipped with OpenSSL 1.1.1) will be supported everywhere.

 - Debian buster: 1.1.1[^2]
 - Ubuntu 20.04: 1.1.1[^3]
 - CentOS/RHEL 7: 1.0.2
 - RHEL 8/Rocky 8/EL 8: 1.1.1
 - Fedora 38: 3.0.9 (`openssl11` provides OpenSSL 1.1 as well)

RHEL/CentOS 7 reaches EOL mid 2024, so for PHP 8.4 scheduled towards the end of this year, we can safely
bump the minimum OpenSSL version.

[^1]: https://www.openssl.org/blog/blog/2023/03/28/1.1.1-EOL/index.html
[^2]: https://packages.debian.org/buster/libssl-dev
[^3]: https://packages.ubuntu.com/focal/libssl-dev
2024-03-23 15:12:06 +00:00
haszi
6150bf5ee4
Fix url_rewriter.hosts not used for output_add_rewrite_var()
If fixes issue where session.trans_sid_hosts used instead of
url_rewriter.hosts for output_add_rewrite_var().

Closes GH-13294
2024-03-22 13:57:43 +00:00
tekimen
4d51bfa270
[RFC] Add mb_ucfirst and mb_lcfirst functions (#13161) 2024-03-20 17:25:19 +01:00
Arnaud Le Blanc
df7252624f [ci skip] NEWS 2024-03-19 13:06:29 +01:00
David Carlier
4c467e6eb8 ext/sockets: adding few constants for NetBSD.
SOCK_CONN_DGRAM (and its alias SOCK_DCCP) for connection orientated
datagram.

Close GH-13728
2024-03-17 21:44:22 +00:00