From: Wez Furlong Date: Sun, 4 Sep 2005 04:51:23 +0000 (+0000) Subject: Allow ext/mysql to build against PHP 4 again; update package.xml ready for X-Git-Tag: php-5.1.0RC2_PRE~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6be0f981770dced81981d011707ae57d089aba2;p=php Allow ext/mysql to build against PHP 4 again; update package.xml ready for release via PECL. --- diff --git a/ext/mysql/config.m4 b/ext/mysql/config.m4 index cad03630b4..3e8bbdfb20 100644 --- a/ext/mysql/config.m4 +++ b/ext/mysql/config.m4 @@ -93,6 +93,11 @@ Note that the MySQL client library is not bundled anymore!]) ;; esac + dnl for compat with PHP 4 build system + if test -z "$PHP_LIBDIR"; then + PHP_LIBDIR=lib + fi + for i in $PHP_LIBDIR $PHP_LIBDIR/mysql; do MYSQL_LIB_CHK($i) done diff --git a/ext/mysql/package.xml b/ext/mysql/package.xml index f1e0c2c1ad..adb7522031 100644 --- a/ext/mysql/package.xml +++ b/ext/mysql/package.xml @@ -1,7 +1,7 @@ - mysqli + mysql MySQL database access functions @@ -28,11 +28,12 @@ These functions allow you to access MySQL database servers. PHP - beta - 5.0.0rc1 - 2004-03-19 + stable + 5.1 + 2005-09-04 -package.xml added to support intallation using pear installer +This is the MySQL driver, taken from the PHP 5.1 release. +It can also be built against PHP 4. @@ -54,7 +55,7 @@ package.xml added to support intallation using pear installer - + 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 + } /* }}} */