Skip to content

Use forward compatible Mysql constants of ipl-sql#270

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

Use forward compatible Mysql constants of ipl-sql#270
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

Copy link
Copy Markdown
Member

@lippserd lippserd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change is missing raise of the Icinga PHP Library requirement in docs. Also, adjust commit title and description to be the same as Icinga/icingaweb2@298f524.

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 added this to the 1.1.0 milestone Mar 25, 2026
@lippserd lippserd merged commit 11e34f5 into main Mar 25, 2026
13 checks passed
@lippserd lippserd deleted the mysql-constants branch March 25, 2026 10:32
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