Bug #47257 [Com]: SQLite3->__construct has no sane way to detect errors

From: Date: Tue, 02 Oct 2012 23:33:44 +0000
Subject: Bug #47257 [Com]: SQLite3->__construct has no sane way to detect errors
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8925@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=47257&edit=1 ID: 47257 Comment by: niel dot archer at gmail dot com Reported by: cellog@php.net Summary: SQLite3->__construct has no sane way to detect errors Status: Open Type: Bug Package: Documentation problem Operating System: * PHP Version: 5.3.0beta1 Block user comment: N Private report: N New Comment: Doc updated via PHP DOE. If accepted there is also a user note to remove when closing this. Previous Comments: ------------------------------------------------------------------------ [2009-02-10 01:07:19] cellog@php.net the constructor throws exceptions (for the doc team) ------------------------------------------------------------------------ [2009-02-10 00:44:36] scottmac@php.net This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ [2009-02-01 17:51:57] scottmac@php.net I'll add an error mode option and probably default it to an exception. I'm not a huge fan of heavy exception throwing code, you end up wrapping huge blocks of code in try {}. ------------------------------------------------------------------------ [2009-02-01 17:22:53] crrodriguez at suse dot de Exceptions only IMHO, it is a "new" OOP only extension, kinda odd that it throws only notices on errors... ------------------------------------------------------------------------ [2009-01-31 19:22:22] cellog@php.net Description: ------------ SQLite3->__construct does not indicate errors by anything other than an E_NOTICE. This means we have to set a user error handler just to tell whether or not this code succeeds: <?php $a = new SQLite3('/path/to/database.sqlite'); ?> the constructor should throw an exception, or provide an error string parameter by reference like the SQLite object. Reproduce code: --------------- <?php // run as non-root $a = new SQLite3('/root/database.sqlite'); ?> Expected result: ---------------- exception Actual result: -------------- E_NOTICE error ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=47257&edit=1

« previous php.doc.bugs (#8925) next »