-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[zend-db] fix MySQLi adapter after changing default reporting mode by PHP 8.1 #156
Conversation
4599ade
to
8c2b20d
Compare
Thanks @partikus ! Please adjust the PR title to reflect the issue what it is really addressing. Tests are not being adjusted at all in this PR. |
73e48ed
to
de263a6
Compare
@falkenhawk updated, thank you for your comments 👍 |
de263a6
to
dee57f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks 👏
@@ -37,4 +37,16 @@ | |||
*/ | |||
class Zend_Db_Adapter_Mysqli_Exception extends Zend_Db_Adapter_Exception | |||
{ | |||
public static function fromMysqliException($exception) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typing could be added: public static function fromMysqliException(mysqli_sql_exception $exception)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://php.watch/versions/8.1/mysqli-error-mode
https://www.php.net/manual/en/class.mysqli-sql-exception.php
There were 2 ways how to solve it:
MYSQLI_REPORT_OFF
when no special config is givenI've chosen 2nd option taking inspiration from doctrine/dbal#4875
After adjusting MySQLi stuff we ended with:
No errors, failures for PHP 8.1.