Skip to content

Conversation

@dakujem
Copy link
Contributor

@dakujem dakujem commented Jun 22, 2021

  • new feature, no existing code will break (full bc)

I added support for PDO in PDO::ERRMODE_EXCEPTION error mode using a single try-catch block.

👉 Since in PHP 8 PDO::ERRMODE_EXCEPTION is the default error mode!

@dakujem dakujem changed the title PDO: Support for PDO::ERRMODE_EXCEPTION PDO: Support for PDO::ERRMODE_EXCEPTION (PHP8) Jun 22, 2021
@dg dg force-pushed the master branch 3 times, most recently from 45c0839 to 8881eb1 Compare November 29, 2021 12:49
@dg dg force-pushed the master branch 3 times, most recently from 80c861c to 26f2657 Compare December 6, 2021 18:13
@dakujem dakujem force-pushed the feat/support-exception-errmode-php8 branch from fd45178 to e6baef8 Compare December 11, 2021 17:33
@dg
Copy link
Owner

dg commented Dec 12, 2021

I think it would be best to do a BC break and add support (only) for PDO::ERRMODE_EXCEPTION in dibi 5.0 and keep version 4.2 as it is. What do you think?

@dg dg force-pushed the master branch 4 times, most recently from 0efa5c1 to 0bdf956 Compare December 12, 2021 16:47
@dakujem
Copy link
Contributor Author

dakujem commented Dec 14, 2021

Since it is backwards compatible, I see no reason not to include it in v4. It can be the default in v5.

@dakujem
Copy link
Contributor Author

dakujem commented Feb 14, 2025

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
image

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.

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.

3 participants