summaryrefslogtreecommitdiff
path: root/ext/mysql
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:34:59 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:34:59 -0400
commitce7edc9b3c7370f32fec0bc7a8ec3e29ed9a5f61 (patch)
treeacdb9a8816483652a9db1a47db71df5df43707c5 /ext/mysql
parent10f5b47dc7c1cf2b9a00991629f43652710322d3 (diff)
downloadphp-ce7edc9b3c7370f32fec0bc7a8ec3e29ed9a5f61.tar.gz
Imported Upstream version 5.1.1upstream/5.1.1
Diffstat (limited to 'ext/mysql')
-rw-r--r--ext/mysql/config.m444
-rw-r--r--ext/mysql/config.w325
-rw-r--r--ext/mysql/package.xml13
-rw-r--r--ext/mysql/php_mysql.c29
-rw-r--r--ext/mysql/php_mysql.h4
-rwxr-xr-xext/mysql/tests/001.phpt2
6 files changed, 60 insertions, 37 deletions
diff --git a/ext/mysql/config.m4 b/ext/mysql/config.m4
index d167b5c22..4eed751d9 100644
--- a/ext/mysql/config.m4
+++ b/ext/mysql/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.61.2.3 2005/06/20 13:46:02 sniper Exp $
+dnl $Id: config.m4,v 1.67.2.1 2005/09/04 04:51:23 wez Exp $
dnl
AC_DEFUN([MYSQL_LIB_CHK], [
- str="$MYSQL_DIR/$1/lib$MY_LIBNAME.*"
+ str="$MYSQL_DIR/$1/lib$MYSQL_LIBNAME.*"
for j in `echo $str`; do
if test -r $j; then
MYSQL_LIB_DIR=$MYSQL_DIR/$1
@@ -40,15 +40,15 @@ AC_DEFUN([PHP_MYSQL_SOCKET_SEARCH], [
PHP_ARG_WITH(mysql, for MySQL support,
-[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base directory.])
+[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base directory])
PHP_ARG_WITH(mysql-sock, for specified location of the MySQL UNIX socket,
[ --with-mysql-sock[=DIR] MySQL: Location of the MySQL unix socket pointer.
- If unspecified, the default locations are searched.], no, no)
+ If unspecified, the default locations are searched], no, no)
if test -z "$PHP_ZLIB_DIR"; then
PHP_ARG_WITH(zlib-dir, for the location of libz,
- [ --with-zlib-dir[=DIR] MySQL: Set the path to libz install prefix.], no, no)
+ [ --with-zlib-dir[=DIR] MySQL: Set the path to libz install prefix], no, no)
fi
@@ -66,6 +66,9 @@ if test "$PHP_MYSQL" != "no"; then
AC_MSG_RESULT([no])
fi
+ MYSQL_DIR=
+ MYSQL_INC_DIR=
+
for i in $PHP_MYSQL /usr/local /usr; do
if test -r $i/include/mysql/mysql.h; then
MYSQL_DIR=$i
@@ -80,38 +83,43 @@ if test "$PHP_MYSQL" != "no"; then
if test -z "$MYSQL_DIR"; then
AC_MSG_ERROR([Cannot find MySQL header files under $PHP_MYSQL.
-Note that the MySQL client library is not bundled anymore.])
+Note that the MySQL client library is not bundled anymore!])
fi
- MY_LIBNAME=mysqlclient
+ MYSQL_LIBNAME=mysqlclient
case $host_alias in
*netware*[)]
- MY_LIBNAME=mysql
+ MYSQL_LIBNAME=mysql
;;
esac
- for i in lib lib/mysql lib64 lib64/mysql; do
+ 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
if test -z "$MYSQL_LIB_DIR"; then
- AC_MSG_ERROR([Cannot find libmysqlclient under $MYSQL_DIR.
-Note that the MySQL client library is not bundled anymore.])
+ AC_MSG_ERROR([Cannot find lib$MYSQL_LIBNAME under $MYSQL_DIR.
+Note that the MySQL client library is not bundled anymore!])
fi
- PHP_CHECK_LIBRARY($MY_LIBNAME, mysql_close, [ ],
+ PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_close, [ ],
[
if test "$PHP_ZLIB_DIR" != "no"; then
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR, MYSQL_SHARED_LIBADD)
- PHP_CHECK_LIBRARY($MY_LIBNAME, mysql_error, [], [
+ PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_error, [], [
AC_MSG_ERROR([mysql configure failed. Please check config.log for more information.])
], [
- -L$PHP_ZLIB_DIR/lib -L$MYSQL_LIB_DIR
+ -L$PHP_ZLIB_DIR/$PHP_LIBDIR -L$MYSQL_LIB_DIR
])
- MYSQL_LIBS="-L$PHP_ZLIB_DIR/lib -lz"
+ MYSQL_LIBS="-L$PHP_ZLIB_DIR/$PHP_LIBDIR -lz"
else
PHP_ADD_LIBRARY(z,, MYSQL_SHARED_LIBADD)
- PHP_CHECK_LIBRARY($MY_LIBNAME, mysql_errno, [], [
+ PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_errno, [], [
AC_MSG_ERROR([Try adding --with-zlib-dir=<DIR>. Please check config.log for more information.])
], [
-L$MYSQL_LIB_DIR
@@ -122,13 +130,13 @@ Note that the MySQL client library is not bundled anymore.])
-L$MYSQL_LIB_DIR
])
- PHP_ADD_LIBRARY_WITH_PATH($MY_LIBNAME, $MYSQL_LIB_DIR, MYSQL_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH($MYSQL_LIBNAME, $MYSQL_LIB_DIR, MYSQL_SHARED_LIBADD)
PHP_ADD_INCLUDE($MYSQL_INC_DIR)
PHP_NEW_EXTENSION(mysql, php_mysql.c, $ext_shared)
MYSQL_MODULE_TYPE=external
- MYSQL_LIBS="-L$MYSQL_LIB_DIR -l$MY_LIBNAME $MYSQL_LIBS"
+ MYSQL_LIBS="-L$MYSQL_LIB_DIR -l$MYSQL_LIBNAME $MYSQL_LIBS"
MYSQL_INCLUDE=-I$MYSQL_INC_DIR
PHP_SUBST(MYSQL_SHARED_LIBADD)
diff --git a/ext/mysql/config.w32 b/ext/mysql/config.w32
index 9c4dc4522..267f2c3d1 100644
--- a/ext/mysql/config.w32
+++ b/ext/mysql/config.w32
@@ -1,11 +1,12 @@
-// $Id: config.w32,v 1.1 2003/12/05 06:09:29 sebastian Exp $
+// $Id: config.w32,v 1.2 2005/06/05 19:25:00 wez Exp $
// vim:ft=javascript
ARG_WITH("mysql", "MySQL support", "no");
if (PHP_MYSQL != "no") {
if (CHECK_LIB("libmysql.lib", "mysql", PHP_MYSQL) &&
- CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQL", PHP_PHP_BUILD + "\\include\\mysql;" + PHP_MYSQL)) {
+ CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQL",
+ PHP_MYSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\mysql;" + PHP_MYSQL)) {
EXTENSION("mysql", "php_mysql.c");
AC_DEFINE('HAVE_MYSQL', 1, 'Have MySQL library');
} else {
diff --git a/ext/mysql/package.xml b/ext/mysql/package.xml
index f1e0c2c1a..79fd6ba90 100644
--- a/ext/mysql/package.xml
+++ b/ext/mysql/package.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE package SYSTEM "../pear/package.dtd">
<package>
- <name>mysqli</name>
+ <name>mysql</name>
<summary>MySQL database access functions</summary>
<maintainers>
<maintainer>
@@ -28,11 +28,12 @@ These functions allow you to access MySQL database servers.
</description>
<license>PHP</license>
<release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
+ <state>stable</state>
+ <version>1.0</version>
+ <date>2005-09-04</date>
<notes>
-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.
</notes>
<configureoptions>
<configureoption name="with-mysql" default="autodetect" prompt="mysql installation dir?"/>
@@ -54,7 +55,7 @@ package.xml added to support intallation using pear installer
<file role="test" name="tests/skipif.inc"/>
</filelist>
<deps>
- <dep type="php" rel="ge" version="5" />
+ <dep type="php" rel="ge" version="4" />
</deps>
</release>
</package>
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 2fb926c1c..163d3c514 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_mysql.c,v 1.209.2.2 2005/04/07 22:23:28 sniper Exp $ */
+/* $Id: php_mysql.c,v 1.213.2.2 2005/09/04 17:10:56 wez Exp $ */
/* TODO:
*
@@ -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
@@ -211,7 +218,7 @@ zend_module_entry mysql_module_entry = {
PHP_RINIT(mysql),
PHP_RSHUTDOWN(mysql),
PHP_MINFO(mysql),
- NO_VERSION_YET,
+ "1.0",
STANDARD_MODULE_PROPERTIES
};
/* }}} */
@@ -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
+
}
/* }}} */
@@ -2248,9 +2261,9 @@ PHP_FUNCTION(mysql_fetch_field)
}
object_init(return_value);
- add_property_string(return_value, "name",(mysql_field->name?mysql_field->name:empty_string), 1);
- add_property_string(return_value, "table",(mysql_field->table?mysql_field->table:empty_string), 1);
- add_property_string(return_value, "def",(mysql_field->def?mysql_field->def:empty_string), 1);
+ add_property_string(return_value, "name",(mysql_field->name?mysql_field->name:""), 1);
+ add_property_string(return_value, "table",(mysql_field->table?mysql_field->table:""), 1);
+ add_property_string(return_value, "def",(mysql_field->def?mysql_field->def:""), 1);
add_property_long(return_value, "max_length", mysql_field->max_length);
add_property_long(return_value, "not_null", IS_NOT_NULL(mysql_field->flags)?1:0);
add_property_long(return_value, "primary_key", IS_PRI_KEY(mysql_field->flags)?1:0);
diff --git a/ext/mysql/php_mysql.h b/ext/mysql/php_mysql.h
index 02984e227..739cff7b1 100644
--- a/ext/mysql/php_mysql.h
+++ b/ext/mysql/php_mysql.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
*/
-/* $Id: php_mysql.h,v 1.36 2004/01/08 17:32:29 sniper Exp $ */
+/* $Id: php_mysql.h,v 1.37 2005/08/03 14:07:30 sniper Exp $ */
#ifndef PHP_MYSQL_H
#define PHP_MYSQL_H
diff --git a/ext/mysql/tests/001.phpt b/ext/mysql/tests/001.phpt
index 5d36462ba..8a7c9d22c 100755
--- a/ext/mysql/tests/001.phpt
+++ b/ext/mysql/tests/001.phpt
@@ -19,7 +19,7 @@ $test .= ($db) ? '1' : '0';
mysql_close($db);
/*** test mysql_connect localhost:port ***/
-$db = mysql_connect($host, $user, $passwd, '', 3306);
+$db = mysql_connect("{$host}:3306", $user, $passwd, '');
$test .= ($db) ? '1' : '0';
mysql_close($db);