diff options
author | Marcus Boerger <helly@php.net> | 2005-01-24 18:46:50 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2005-01-24 18:46:50 +0000 |
commit | 7ec2fe9dcdd1b4cfa904c24f343dd3a8ee04ce8a (patch) | |
tree | 5c9bb34c83cdfcac0269f9a73570fe05bec635d0 /ext/sqlite/sqlite.c | |
parent | 76d91f2a3d6d9ce2813b501622a80ac79857f015 (diff) | |
download | php-git-7ec2fe9dcdd1b4cfa904c24f343dd3a8ee04ce8a.tar.gz |
- Synch with MYSQLi extension and use RuntimeException as base for
SQLiteException if SPL is present.
Diffstat (limited to 'ext/sqlite/sqlite.c')
-rw-r--r-- | ext/sqlite/sqlite.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index 8d72cf816b..8e0076643a 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -44,6 +44,10 @@ #include "zend_exceptions.h" #include "zend_interfaces.h" +#ifdef HAVE_SPL +extern PHPAPI zend_class_entry *spl_ce_RuntimeException; +#endif + #ifndef safe_emalloc # define safe_emalloc(a,b,c) emalloc((a)*(b)+(c)) #endif @@ -998,7 +1002,11 @@ PHP_MINIT_FUNCTION(sqlite) REGISTER_SQLITE_CLASS(Database, db, NULL); REGISTER_SQLITE_CLASS(Result, query, NULL); REGISTER_SQLITE_CLASS(Unbuffered, ub_query, NULL); +#ifdef HAVE_SPL + REGISTER_SQLITE_CLASS(Exception, exception, spl_ce_RuntimeException); +#else REGISTER_SQLITE_CLASS(Exception, exception, zend_exception_get_default()); +#endif sqlite_object_handlers_query.get_class_entry = sqlite_get_ce_query; sqlite_object_handlers_ub_query.get_class_entry = sqlite_get_ce_ub_query; |