summaryrefslogtreecommitdiff
path: root/ext/pdo/pdo.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo/pdo.c')
-rw-r--r--ext/pdo/pdo.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index 77366f817d..20f71491be 100644
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -32,8 +32,7 @@
#include "php_pdo_driver.h"
#include "php_pdo_int.h"
#include "zend_exceptions.h"
-
-static zend_class_entry *spl_ce_RuntimeException;
+#include "ext/spl/spl_exceptions.h"
zend_class_entry *pdo_dbh_ce, *pdo_dbstmt_ce, *pdo_row_ce;
@@ -79,20 +78,9 @@ 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 defined(HAVE_SPL)
if (!root) {
- if (!spl_ce_RuntimeException) {
- zend_class_entry *pce;
-
- if ((pce = zend_hash_str_find_ptr(CG(class_table), "runtimeexception", sizeof("RuntimeException") - 1))) {
- spl_ce_RuntimeException = pce;
- return pce;
- }
- } else {
- return spl_ce_RuntimeException;
- }
+ return spl_ce_RuntimeException;
}
-#endif
return zend_ce_exception;
}
/* }}} */
@@ -128,14 +116,10 @@ const zend_function_entry pdo_functions[] = {
/* }}} */
/* {{{ pdo_functions[] */
-#if ZEND_MODULE_API_NO >= 20050922
static const zend_module_dep pdo_deps[] = {
-#ifdef HAVE_SPL
ZEND_MOD_REQUIRED("spl")
-#endif
ZEND_MOD_END
};
-#endif
/* }}} */
/* {{{ pdo_module_entry */
@@ -175,7 +159,7 @@ static PHP_GINIT_FUNCTION(pdo)
PDO_API int php_pdo_register_driver(pdo_driver_t *driver) /* {{{ */
{
if (driver->api_version != PDO_DRIVER_API) {
- zend_error(E_ERROR, "PDO: driver %s requires PDO API version %pd; this is PDO version %d",
+ zend_error(E_ERROR, "PDO: driver %s requires PDO API version " ZEND_ULONG_FMT "; this is PDO version %d",
driver->driver_name, driver->api_version, PDO_DRIVER_API);
return FAILURE;
}
@@ -206,7 +190,8 @@ pdo_driver_t *pdo_find_driver(const char *name, int namelen) /* {{{ */
PDO_API int php_pdo_parse_data_source(const char *data_source, zend_ulong data_source_len, struct pdo_data_src_parser *parsed, int nparams) /* {{{ */
{
- int i, j;
+ zend_ulong i;
+ int j;
int valstart = -1;
int semi = -1;
int optstart = 0;
@@ -351,8 +336,6 @@ PHP_MINIT_FUNCTION(pdo)
{
zend_class_entry ce;
- spl_ce_RuntimeException = NULL;
-
if (FAILURE == pdo_sqlstate_init_error_table()) {
return FAILURE;
}