Skip to content

Conversation

@crynobone
Copy link
Member

@crynobone crynobone commented Oct 21, 2025

  • Fixes deprecated PDO constants
  • Missing Redis class in PHP 8.5

jnoordsij and others added 12 commits October 1, 2025 12:26
This allows Laravel to handle deprecated constant introduced in PHP 8.5

Signed-off-by: Mior Muhammad Zaki <[email protected]>
Signed-off-by: Mior Muhammad Zaki <[email protected]>
Signed-off-by: Mior Muhammad Zaki <[email protected]>
Signed-off-by: Mior Muhammad Zaki <[email protected]>
Signed-off-by: Mior Muhammad Zaki <[email protected]>
Signed-off-by: Mior Muhammad Zaki <[email protected]>
Signed-off-by: Mior Muhammad Zaki <[email protected]>
}

return (new Collection($features))
->mapWithKeys(fn ($value, $feature) => [(string) Str::of($feature)->prepend(PHP_VERSION_ID < 80400 ? 'PDO::MYSQL_' : 'Pdo\Mysql::') => $value])
Copy link
Contributor

Choose a reason for hiding this comment

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

@crynobone

Where does the constant name as a string get converted to a constant value?

Shouldn't we call constant() after prefixing the constant names to convert them to their values?

Otherwise this would result in something like this:

[
    // constant name as a string value
    'PDO::MYSQL_ATTR_SSL_CA' => env('MYSQL_ATTR_SSL_CA'),
]

Instead of

[
    // PDO::MYSQL_ATTR_SSL_CA = 1009 in my local PHP binary
    1009 => env('MYSQL_ATTR_SSL_CA'),
]

reference: https://www.php.net/manual/en/function.constant.php

Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, Stringable@pipe() returns a new Stringable instance and not the result of the callback.

Otherwise, this could be fixed by adding a ->pipe('constant') call to the Str::of() chain when mapping the keys.

If the constant's value is an integer, I guess the key might also be an integer.

Copy link
Member Author

Choose a reason for hiding this comment

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

This PR will remain as a draft and wait for symfony/polyfill#549

  1. I'm not sure using ATTR_SSL_CA, for example, as key is good for DX, This means we need to include the usage documentation.
  2. Only mysql and sqlite has the deprecation at the moment. This means Connector::features() is only available for some drivers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants