summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/pdo/pdo.c11
-rw-r--r--ext/pdo/pdo_dbh.c12
-rw-r--r--ext/pdo/php_pdo_int.h1
3 files changed, 7 insertions, 17 deletions
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index 9b97ba1416..a66596ee54 100644
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -70,15 +70,6 @@ PDO_API char *php_pdo_str_tolower_dup(const char *src, int len) /* {{{ */
}
/* }}} */
-PDO_API zend_class_entry *php_pdo_get_exception_base(int root) /* {{{ */
-{
- if (!root) {
- return spl_ce_RuntimeException;
- }
- return zend_ce_exception;
-}
-/* }}} */
-
/* {{{ Return array of available PDO drivers */
PHP_FUNCTION(pdo_drivers)
{
@@ -315,7 +306,7 @@ PHP_MINIT_FUNCTION(pdo)
INIT_CLASS_ENTRY(ce, "PDOException", NULL);
- pdo_exception_ce = zend_register_internal_class_ex(&ce, php_pdo_get_exception_base(0));
+ pdo_exception_ce = zend_register_internal_class_ex(&ce, spl_ce_RuntimeException);
zend_declare_property_null(pdo_exception_ce, "errorInfo", sizeof("errorInfo")-1, ZEND_ACC_PUBLIC);
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index 7f4df3f9ae..a7c383bd3a 100644
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -100,12 +100,12 @@ void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate
php_error_docref(NULL, E_WARNING, "%s", message);
} else {
zval ex, info;
- zend_class_entry *def_ex = php_pdo_get_exception_base(1), *pdo_ex = php_pdo_get_exception();
+ zend_class_entry *pdo_ex = php_pdo_get_exception();
object_init_ex(&ex, pdo_ex);
- zend_update_property_string(def_ex, Z_OBJ(ex), "message", sizeof("message")-1, message);
- zend_update_property_string(def_ex, Z_OBJ(ex), "code", sizeof("code")-1, *pdo_err);
+ zend_update_property_string(zend_ce_exception, Z_OBJ(ex), "message", sizeof("message")-1, message);
+ zend_update_property_string(zend_ce_exception, Z_OBJ(ex), "code", sizeof("code")-1, *pdo_err);
array_init(&info);
@@ -175,12 +175,12 @@ PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt) /* {{{ */
php_error_docref(NULL, E_WARNING, "%s", ZSTR_VAL(message));
} else if (EG(exception) == NULL) {
zval ex;
- zend_class_entry *def_ex = php_pdo_get_exception_base(1), *pdo_ex = php_pdo_get_exception();
+ zend_class_entry *pdo_ex = php_pdo_get_exception();
object_init_ex(&ex, pdo_ex);
- zend_update_property_str(def_ex, Z_OBJ(ex), "message", sizeof("message") - 1, message);
- zend_update_property_string(def_ex, Z_OBJ(ex), "code", sizeof("code") - 1, *pdo_err);
+ zend_update_property_str(zend_ce_exception, Z_OBJ(ex), "message", sizeof("message") - 1, message);
+ zend_update_property_string(zend_ce_exception, Z_OBJ(ex), "code", sizeof("code") - 1, *pdo_err);
if (!Z_ISUNDEF(info)) {
zend_update_property(pdo_ex, Z_OBJ(ex), "errorInfo", sizeof("errorInfo") - 1, &info);
diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h
index 87eb79256e..7fe3bfc850 100644
--- a/ext/pdo/php_pdo_int.h
+++ b/ext/pdo/php_pdo_int.h
@@ -23,7 +23,6 @@
extern HashTable pdo_driver_hash;
extern zend_class_entry *pdo_exception_ce;
-PDO_API zend_class_entry *php_pdo_get_exception_base(int root);
int php_pdo_list_entry(void);
void pdo_dbh_init(void);