1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

1105 Commits

Author SHA1 Message Date
Peter Kokot
f17c5ad83b Windows build: Add new function CHECK_HEADER() (#21191)
The current function `CHECK_HEADER_ADD_INCLUDE()` automatically defines
`HAVE_<HEADER_NAME_H>` preprocessor macros, which makes it difficult to
sync with other build systems. Specially, if some `HAVE_` macro is used
in the code and this function defines this macro but Autotools doesn't.

The new `CHECK_HEADER()` function behaves similar except it doesn't
define the `HAVE_<HEADER_NAME_H>` preprocessor macro.

This removes the following unused compile definitions:

HAVE_ARGON2_H
HAVE_AVIF_H
HAVE_BZLIB_H
HAVE_CAPSTONE_CAPSTONE_H
HAVE_CURL_EASY_H
HAVE_DB_H
HAVE_DECODE_H
HAVE_DEPOT_H
HAVE_EDITLINE_READLINE_H
HAVE_ENCHANT_H
HAVE_ENCODE_H
HAVE_FFI_H
HAVE_FIREBIRD_INTERFACE_H
HAVE_FT2BUILD_H
HAVE_GD_H
HAVE_GLIB_H
HAVE_GMP_H
HAVE_HTTPD_H
HAVE_IBASE_H
HAVE_IR_IR_H
HAVE_KECCAKHASH_H
HAVE_LBER_H
HAVE_LDAP_H
HAVE_LIBEXSLT_EXSLT_H
HAVE_LIBINTL_H
HAVE_LIBPQ_FE_H
HAVE_LIBTIDY_TIDY_H
HAVE_LIBXML_PARSER_H
HAVE_LIBXML_TREE_H
HAVE_LIBXML_XMLWRITER_H
HAVE_LIBXSLT_XSLT_H
HAVE_LMDB_H
HAVE_MBSTRING_H
HAVE_MYSQL_H
HAVE_ONIGURUMA_H
HAVE_OPENSSL_SSL_H
HAVE_PNG_H
HAVE_SNMP_H
HAVE_SODIUM_H
HAVE_SQLITE3_H
HAVE_SQLITE3EXT_H
HAVE_SYBFRONT_H
HAVE_TIDY_H
HAVE_TIDY_TIDY_H
HAVE_TIDYBUFFIO_H
HAVE_TIMELIB_CONFIG_H
HAVE_UNICODE_USPOOF_H
HAVE_UNICODE_UTF_H
HAVE_XPM_H
HAVE_ZIP_H
HAVE_ZIPCONF_H
HAVE_ZLIB_H

The following compile definitions are defined explicitly:

- HAVE_ICONV_H
- HAVE_MSCOREE_H
- HAVE_SQL_H
- HAVE_SQLEXT_H

Additionally, the `SETUP_OPENSSL()` function doesn't accept the 6th
argument anymore.
2026-03-03 20:06:40 +01:00
Arnaud Le Blanc
65b4073922 Include the actual stub name in generated arginfo headers (#20993) 2026-01-21 20:57:00 +01:00
Daniel Scherzer
65c367f982 pdo_mysql___construct_options.phpt: remove unexpected Cedilla (#20692)
[skip ci]
2025-12-17 21:14:15 -08:00
Niels Dossche
7455f6a5b0 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix macro check that I forgot to commit
  Fix UAF in tidy when tidySetErrorBuffer() fails
2025-10-24 21:20:58 +02:00
Niels Dossche
67926db749 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix macro check that I forgot to commit
  Fix UAF in tidy when tidySetErrorBuffer() fails
2025-10-24 21:20:52 +02:00
Niels Dossche
aebe5c92a9 Fix macro check that I forgot to commit 2025-10-24 21:20:28 +02:00
Niels Dossche
5887c76c8c Merge branch 'PHP-8.5'
* PHP-8.5:
  Use MYSQL_TYPE constants instead of FIELD_TYPE
2025-10-23 18:46:43 +02:00
Niels Dossche
dd6a320222 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Use MYSQL_TYPE constants instead of FIELD_TYPE
2025-10-23 18:46:37 +02:00
Niels Dossche
ef32a3bd8a Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Use MYSQL_TYPE constants instead of FIELD_TYPE
2025-10-23 18:46:31 +02:00
Niels Dossche
c7fc819c2d Use MYSQL_TYPE constants instead of FIELD_TYPE
The FIELD_TYPE constants are for BC. The JSON/VECTOR types are not
defined in FIELD_TYPE for libmysqlclient.
MYSQL_TYPE is available since MYSQL 5.0.0, so switch to that.

Since MYSQL_TYPEs are enums and not defines, we need version checks
instead.
JSON was added in mysql 8.0.0 in mysql/mysql-server@c240455145
JSON support was backported via mysql/mysql-server@3e14f9f in 5.7.8.
VECTOR was added in mysql 9.0.0 in mysql/mysql-server@8cd51511de

Replaces GH-20245.
2025-10-23 18:45:34 +02:00
Niels Dossche
72a18f863a Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix test on 8.4+ (#20196)
2025-10-17 09:12:28 +02:00
Niels Dossche
a5578810bd Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix test on 8.4+ (#20196)
2025-10-17 09:12:22 +02:00
Niels Dossche
a576a3d5d4 Fix test on 8.4+ (#20196)
* Fix test on 8.4+

* more fixes

* Fix include path
2025-10-17 09:12:10 +02:00
Niels Dossche
009cf303f9 Merge branch 'PHP-8.5'
* PHP-8.5:
  [ci skip] Fail test temporarily
2025-10-17 00:10:19 +02:00
Niels Dossche
41a8b3cd1b Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  [ci skip] Fail test temporarily
2025-10-17 00:10:11 +02:00
Niels Dossche
6980d51f52 [ci skip] Fail test temporarily 2025-10-17 00:10:02 +02:00
Niels Dossche
be97470dfd Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix test on 8.4+
2025-10-16 23:54:12 +02:00
Niels Dossche
6a572d7b0d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix test on 8.4+
2025-10-16 23:54:07 +02:00
Niels Dossche
1570f6a6b2 Fix test on 8.4+ 2025-10-16 23:54:02 +02:00
Niels Dossche
984416dde3 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20122: getColumnMeta() for JSON-column in MySQL
2025-10-16 22:56:24 +02:00
Niels Dossche
02bd332040 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20122: getColumnMeta() for JSON-column in MySQL
2025-10-16 22:56:17 +02:00
Niels Dossche
4fa45096a7 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-20122: getColumnMeta() for JSON-column in MySQL
2025-10-16 22:56:09 +02:00
Niels Dossche
94284df7b2 Fix GH-20122: getColumnMeta() for JSON-column in MySQL
While at it, also add VECTOR.

Closes GH-20143.
2025-10-16 22:55:17 +02:00
Jakub Zelenka
c07b9cc49d Merge branch 'PHP-8.5' 2025-10-06 10:32:28 +02:00
Nicolas Grekas
fc353966f3 Revert deprecation of __sleep and __wakeup (#19966) 2025-10-06 10:30:27 +02:00
Niels Dossche
57ce245e1e Reduce code bloat in arginfo by using specialised string releases (#20016)
* Reduce code bloat in arginfo by using specialised string releases

Comparing this patch to master (c7da728574),
with a plain configure command without any options:

```
   text	   data	    bss	    dec	    hex	filename
20683738	1592400	 137712	22413850	156021a	sapi/cli/php
20688522	1592400	 137712	22418634	15614ca	sapi/cli/php_old
```

We see a minor reduction of 0.023% in code size.

* Also use true for the other initialization line

* Also use specialized code for consts
2025-10-02 22:00:20 +02:00
Tim Düsterhus
aa08831b0c pdo_mysql: Use true / false instead of 1 / 0 when assigning to bool
Changes done with Coccinelle:

    @@
    bool b;
    @@

    - b = 0
    + b = false

    @@
    bool b;
    @@

    - b = 1
    + b = true
2025-09-24 18:51:40 +02:00
Gina Peter Banyard
a5f2eee785 Zend: Deprecate __wakeup() (#19435)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods
2025-09-11 06:57:21 +01:00
Gina Peter Banyard
f18e99244b Zend: Deprecate __sleep() (#19682)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods
2025-09-10 08:54:16 +01:00
Arnaud Le Blanc
6f32e1c690 Deprecate driver specific PDO constants
RFC: https://wiki.php.net/rfc/deprecations_php_8_5.

Closes GH-19526
2025-08-26 09:06:19 +02:00
Tim Düsterhus
732069d98b pdo: Deprecate the uri: DSN scheme (#19274)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_pdo_s_urischeme
2025-08-08 21:24:15 +01:00
Gina Peter Banyard
1e0c8baf05 tree: drop non canonical casts and ZPP tests 2025-08-06 13:20:28 +01:00
Alexandre Daubois
433c00b348 [skip ci] tree: Fix various typos (#19366) 2025-08-04 15:15:52 +01:00
DanielEScherzer
ddd33fd7e4 Generated arginfo headers: combine preprocessor conditional blocks (2) (#18667)
When global constants' or class constants' availability is based on some
preprocessor condition, the generated arginfo header files wrap the
declarations in the preprocessor `#if` conditional blocks, one per declaration,
even if they are in the same conditional block based on comments in the stub
file. Instead of having multiple conditional blocks one after the other with
the same condition, combine them into a single conditional block.
2025-06-22 14:35:28 -07:00
Gina Peter Banyard
790286ab6c ext/pdo: Pass argument number to pdo_dbh_attribute_set() 2025-02-04 19:28:47 +00:00
Niels Dossche
6f4579af85 Introduce php_pdo_stmt_valid_db_obj_handle() (#17567) 2025-01-28 21:54:11 +01:00
Gina Peter Banyard
576f5fac23 ext/pdo: Move PDO MySQL test to common 2025-01-09 10:30:10 +00:00
Gina Peter Banyard
4dd9acccd2 ext/pdo: Move common PDO bug test and enhance it 2025-01-07 09:10:05 +00:00
Kamil Tekiela
f0554477ae Make PDO_MYSQL_ATTR_DIRECT_QUERY a proper alias (#16935) 2024-12-26 22:26:40 +00:00
Saki Takamachi
5faef8e6c9 Fixed the test because libmysql results type is string. (#16709)
closes #16709
2024-11-06 21:07:03 +09:00
Máté Kocsis
a5f137821a Fix GH-16314 "Pdo\Mysql object is uninitialized" when opening a persistent connection (#16369) 2024-11-05 08:32:44 +01:00
Matteo Beccati
cba92beac3 PDO_MYSQL: Properly quote binary strings
Closes GH-15949
2024-10-07 11:04:50 +02:00
Luís Cobucci
93c68caeb5 Reproduce unexpected MySQL warnings for binary values
The prepared statement emulation layer is handling binary content in a
way that creates warnings in MySQL.

When analysing the query logs, we saw that the content sent to the
server is missing `0x5C` characters when the using emulated prepares.

This introduces a minimal test case that reproduces the issue to aid the
solution.

More info: https://github.com/doctrine/dbal/pull/6522#issuecomment-2340939347

Signed-off-by: Luís Cobucci <lcobucci@gmail.com>
2024-10-07 09:29:02 +02:00
Christoph M. Becker
50b3a0d011 Add comments about internal headers (GH-15689)
A common convention is to name internal C header files as `*_int.h`.
Since a couple of these are actually installed, we add comments that
this is not supposed to happen, (a) to avoid installing further
internal headers, and (b) to pave the way to fix this in the next major
PHP version.

Somewhat special is php_gmp_int.h, where "int" is meant as abbreviation
for "interface".

Another common convention is appending `_priv` or `_private`, but since
there have not been any issues regarding these headers so far, we
refrain from adding respective comments to these headers.

Anyhow, it might be a good idea to introduce some common naming
convention for such internal/private headers.
2024-09-08 16:11:25 +02:00
Christoph M. Becker
a57ce052cd Don't export php_pdo_int.h
This is, as the name and a comment in the header imply, an internal
header which is not supposed to be used by extensions other than PDO
(not even by drivers).

Since there is apparently no need to include this header in the parsers
of the drivers, we remove these includes, and no longer declare the
header to be installed.  Given that the header is only exported for a
couple of weeks[1], this is not considered to be a BC break, because
it's unlikely that external drivers have already been adjusted to use
this header, and otherwise they can still be fixed; PHP 8.4 is still in
the pre-release stage.

[1] <https://github.com/php/php-src/pull/14797>

Closes GH-15688.
2024-09-01 13:33:53 +02:00
Peter Kokot
5ed1659039 Autotools: Fix pdo_mysql build with mysql client library (#15450)
When using --with-pdo-mysql=DIR and for some reason DIR wouldn't have
the executable DIR/bin/mysql_config available the 3rd option was so far
to guess the mysql client library locations and pass the include
directory further. The library directory and library name to link was
missing. This fixes this case for consistency reasons. And in the future
also the pkg-config could be a reliable alternative to mysql_config in
that case. The PDO_MYSQL_INC_DIR is already processed PHP_EVAL_INCLINE
so redundant PHP_ADD_INCLUDE is removed.
2024-08-31 02:35:34 +02:00
Máté Kocsis
8d12f666ae Fix registration of internal readonly child classes (#15459)
Currently, internal classes are registered with the following code:

INIT_CLASS_ENTRY(ce, "InternalClass", class_InternalClass_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ...;

This has worked well so far, except if InternalClass is readonly. It is because some inheritance checks are run by zend_register_internal_class_ex before ZEND_ACC_READONLY_CLASS is added to ce_flags.

The issue is fixed by adding a zend_register_internal_class_with_flags() zend API function that stubs can use from now on. This function makes sure to add the flags before running any checks. Since the new API is not available in lower PHP versions, gen_stub.php has to keep support for the existing API for PHP 8.3 and below.
2024-08-24 12:36:54 +02:00
Gina Peter Bnayard
5853cdb73d Use "must not" instead of "cannot" wording 2024-08-21 21:12:17 +01:00
Peter Kokot
693ec809b9 Autotools: Remove PDO dependency related errors (#15347)
Follow-up of GH-15344 (687eb9125a)

This removes the customized error messages in PDO extensions when PDO is
not enabled (--disable-all or --disable-pdo) in favor of the default
error done by PHP_ADD_EXTENSION_DEP.
2024-08-11 21:35:36 +02:00
Peter Kokot
a5f8cbd93d Autotools: Refactor mysql_config checks in pdo_mysql (#15336)
- Scattered if blocks moved together as PDO_MYSQL_UNIX_ADDR is defined
  only when mysql_config is available
- Obsolete backticks command substitutions `...` replaced with the
  recommended $(...)
2024-08-11 12:18:27 +02:00