Skip to content

Use forward compatible Mysql constants of ipl-sql#268

Merged
lippserd merged 1 commit intomainfrom
mysql-constants
Mar 25, 2026
Merged

Use forward compatible Mysql constants of ipl-sql#268
lippserd merged 1 commit intomainfrom
mysql-constants

Conversation

@BastianLedererIcinga
Copy link
Copy Markdown
Contributor

For PHP < 8.4 the constant Pdo\Mysql::ATTR_INIT_COMMAND is not yet available but its predecessor is deprecated.
Instead of using a version_compare to solve this problem, a forward compatibility shim of ipl-sql can be used to support these versions.

requires: Icinga/ipl-sql#99

@cla-bot cla-bot Bot added the cla/signed label Mar 10, 2026
@BastianLedererIcinga BastianLedererIcinga force-pushed the mysql-constants branch 2 times, most recently from aa0256b to 7ebf045 Compare March 25, 2026 09:15
Replace deprecated `PDO::MYSQL_*` constant usage with the driver-specific
`Pdo\Mysql::ATTR_*` constants introduced in PHP 8.4.

This prepares the code for PHP 8.5, where accessing MySQL driver constants
through the generic `PDO` class is deprecated.

This change requires a compatibility shim on older PHP versions to provide
`Pdo\Mysql` for runtimes that do not expose the driver-specific class yet.  The
shim is provided in `ipl-sql`. As a consequence, the required version of the
Icinga PHP library has been raised.
@lippserd lippserd merged commit 65b8661 into main Mar 25, 2026
13 checks passed
@lippserd lippserd deleted the mysql-constants branch March 25, 2026 10:26
@lippserd lippserd added this to the 1.4.0 milestone Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants