dg / dibi

Dibi - smart database abstraction layer
https://dibiphp.com
Other
487 stars 135 forks source link

SQLite3::enableExceptions(false) is deprecated in PHP 8.3 and later #452

Open ferenclakos opened 6 months ago

ferenclakos commented 6 months ago

Version: 5.0.1 PHP: 8.3.1

Bug Description

I get a warning message when I use SQLite driver.

Deprecated:  SQLite3::enableExceptions(): Use of warnings for SQLite3 is deprecated in
.../vendor/dibi/dibi/src/Dibi/Drivers/SqliteDriver.php on line 60

Steps To Reproduce

$connection = new Connection([
  'driver' => 'sqlite',
  'database' => 'example.s3db',
]);

More Information

dg commented 6 months ago

If I understand correctly, SQLite only throws exceptions since PHP 8.3. This means that we need to modify Dibi\Drivers\SqliteDriver. First, in __construct it must activate exceptions for older PHP versions. And then catch and handle them in query(). I will be glad for PR.