-
-
Notifications
You must be signed in to change notification settings - Fork 144
PDO: Support for PDO::ERRMODE_EXCEPTION (PHP8) #394
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
base: master
Are you sure you want to change the base?
Conversation
45c0839 to
8881eb1
Compare
80c861c to
26f2657
Compare
fd45178 to
e6baef8
Compare
|
I think it would be best to do a BC break and add support (only) for |
0efa5c1 to
0bdf956
Compare
|
Since it is backwards compatible, I see no reason not to include it in v4. It can be the default in v5. |
4947fa5 to
04f006a
Compare
|
I don't fully understand why this useful feature is still not integrated after 4 years. Came across a note in my code that works around this shortcoming, just to see nothing has been done here nor in #393 ... now there is Dibi v5 already out which only runs on PHP 8 and that means in default settings this PDO driver will simply not work. See here: https://www.php.net/manual/en/pdo.error-handling.php Because of the private-access props in the driver, there is no way to just tweak the piece of code in the constructor, so one needs to copy the whole driver. 🤦♂️ Seems like releasing a separate package with just the improved PDO driver is the way to go. |
60c2108 to
514bd23
Compare
8157984 to
4ea907a
Compare

I added support for PDO in
PDO::ERRMODE_EXCEPTIONerror mode using a single try-catch block.👉 Since in PHP 8
PDO::ERRMODE_EXCEPTIONis the default error mode!