]> granicus.if.org Git - php/commitdiff
- Synch with MYSQLi extension and use RuntimeException as base for
authorMarcus Boerger <helly@php.net>
Mon, 24 Jan 2005 18:46:50 +0000 (18:46 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 24 Jan 2005 18:46:50 +0000 (18:46 +0000)
  SQLiteException if SPL is present.

ext/sqlite/sqlite.c

index 8d72cf816be37bf7ac8e4f77538056bba1963021..8e0076643ab7d88f356e7720b398c63107a09195 100644 (file)
 #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;