summaryrefslogtreecommitdiff
path: root/ext/mysql/php_mysql.c
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2005-09-04 04:51:23 +0000
committerWez Furlong <wez@php.net>2005-09-04 04:51:23 +0000
commitb6be0f981770dced81981d011707ae57d089aba2 (patch)
treed8eec18897b7a3b230d4b2bbb50d58a4d5ab7e25 /ext/mysql/php_mysql.c
parent60b1f64cc7c6eefce183cd449b19f2069f1f8311 (diff)
downloadphp-git-b6be0f981770dced81981d011707ae57d089aba2.tar.gz
Allow ext/mysql to build against PHP 4 again; update package.xml ready for
release via PECL.
Diffstat (limited to 'ext/mysql/php_mysql.c')
-rw-r--r--ext/mysql/php_mysql.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 06970a09cb..3e09feb6f0 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -33,7 +33,14 @@
#include "php_globals.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
-#include "zend_exceptions.h"
+
+#ifdef ZEND_ENGINE_2
+# include "zend_exceptions.h"
+#else
+ /* PHP 4 compat */
+# define OnUpdateLong OnUpdateInt
+# define E_STRICT E_NOTICE
+#endif
#if HAVE_MYSQL
@@ -1904,6 +1911,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
zval *res, *ctor_params = NULL;
zend_class_entry *ce;
+#ifdef ZEND_ENGINE_2
if (into_object) {
char *class_name;
int class_name_len;
@@ -1922,7 +1930,9 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
return;
}
result_type = MYSQL_ASSOC;
- } else {
+ } else
+#endif
+ {
if (ZEND_NUM_ARGS() > expected_args) {
WRONG_PARAM_COUNT;
}
@@ -1997,6 +2007,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
}
}
+#ifdef ZEND_ENGINE_2
if (into_object) {
zval dataset = *return_value;
zend_fcall_info fci;
@@ -2060,6 +2071,8 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
}
}
+#endif
+
}
/* }}} */