summaryrefslogtreecommitdiff
path: root/ext/odbc
diff options
context:
space:
mode:
Diffstat (limited to 'ext/odbc')
-rw-r--r--ext/odbc/config.m464
-rw-r--r--ext/odbc/php_odbc.c18
-rw-r--r--ext/odbc/php_odbc.h23
3 files changed, 79 insertions, 26 deletions
diff --git a/ext/odbc/config.m4 b/ext/odbc/config.m4
index 01406cd37e..e0b6093655 100644
--- a/ext/odbc/config.m4
+++ b/ext/odbc/config.m4
@@ -2,36 +2,72 @@ dnl
dnl Figure out which library file to link with for the Solid support.
dnl
AC_DEFUN(AC_FIND_SOLID_LIBS,[
- AC_MSG_CHECKING([Solid library file])
+ AC_MSG_CHECKING([Solid library file])
+ ac_solid_uname_r=`uname -r 2>/dev/null`
ac_solid_uname_s=`uname -s 2>/dev/null`
case $ac_solid_uname_s in
- AIX) ac_solid_os=a3x;;
- HP-UX) ac_solid_os=h9x;;
+ AIX) ac_solid_os=a3x;; # a4x for AIX4
+ HP-UX) ac_solid_os=h9x;; # h1x for hpux11, h0x for hpux10
IRIX) ac_solid_os=irx;;
- Linux) ac_solid_os=lux;;
+ Linux) ac_solid_os=lux;; # this is only valid for libc5 systems, use 'l2x' for glibc2 systems
SunOS) ac_solid_os=ssx;; # should we deal with SunOS 4?
- FreeBSD) ac_solid_os=fbx;;
+ FreeBSD) if [$ac_solid_uname_r < "3."]; then
+ ac_solid_os=fbx
+ else
+ ac_solid_os=fex
+ fi;;
# "uname -s" on SCO makes no sense.
esac
- ODBC_LIBS=`echo $1/scl${ac_solid_os}*.so | cut -d' ' -f1`
+
+ if test -f $1/scl${ac_solid_os}30.a; then
+ ac_solid_verion=30
+ ac_solid_prefix=scl
+ elif test -f $1/scl${ac_solid_os}23.a; then
+ ac_solid_version=23
+ ac_solid_prefix=scl
+ elif test -f $1/soc${ac_solid_os}35.a; then
+ ac_solid_version=35
+ ac_solid_prefix=soc
+ fi
+
+ ODBC_LIBS=`echo $1/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}*.so | cut -d' ' -f1`
if test ! -f $ODBC_LIBS; then
- ODBC_LIBS=`echo $1/scl${ac_solid_os}*.a | cut -d' ' -f1`
+ ODBC_LIBS=`echo $1/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a | cut -d' ' -f1`
fi
if test ! -f $ODBC_LIBS; then
- ODBC_LIBS=`echo $1/scl2x${ac_solid_os}*.a | cut -d' ' -f1`
+ if test $ac_solid_version == 35; then
+ ODBC_LIBS=`echo $1/libsolodbc.so | cut -d' ' -f1`
+ else
+ ODBC_LIBS=`echo $1/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so| cut -d' ' -f1`
+ fi
fi
if test ! -f $ODBC_LIBS; then
- ODBC_LIBS=`echo $1/scl2x${ac_solid_os}*.a | cut -d' ' -f1`
+ if test $ac_solid_version == 35; then
+ ODBC_LIBS=`echo $1/libsolodbc.a | cut -d' ' -f1`
+ else
+ ODBC_LIBS=`echo $1/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a | cut -d' ' -f1`
+ fi
fi
if test ! -f $ODBC_LIBS; then
- ODBC_LIBS=`echo $1/bcl${ac_solid_os}*.so | cut -d' ' -f1`
+ if test $ac_solid_version == 35; then
+ ODBC_LIBS=`echo $1/bcl${ac_solid_prefix}*.so | cut -d' ' -f1`
+ else
+ ODBC_LIBS=`echo $1/bcl${ac_solid_os}*.so | cut -d' ' -f1`
+ fi
fi
if test ! -f $ODBC_LIBS; then
- ODBC_LIBS=`echo $1/bcl${ac_solid_os}*.a | cut -d' ' -f1`
+ if $ac_solid_version == 35; then
+ ODBC_LIBS=`echo $1/bcl${ac_solid_prefix}*.a | cut -d' ' -f1`
+ else
+ ODBC_LIBS=`echo $1/bcl${ac_solid_os}*.a | cut -d' ' -f1`
+ fi
fi
AC_MSG_RESULT(`echo $ODBC_LIBS | sed -e 's!.*/!!'`)
])
+
+
+
dnl
dnl Figure out which library file to link with for the Empress support.
dnl
@@ -110,7 +146,11 @@ AC_ARG_WITH(solid,
ODBC_LIBDIR=$withval/lib
ODBC_INCLUDE=-I$ODBC_INCDIR
ODBC_TYPE=solid
- AC_DEFINE(HAVE_SOLID,1,[ ])
+ if test -f $ODBC_LIBDIR/libsolodbc.a; then
+ AC_DEFINE(HAVE_SOLID_35,1,[ ])
+ else
+ AC_DEFINE(HAVE_SOLID,1,[ ])
+ fi
AC_MSG_RESULT(yes)
AC_FIND_SOLID_LIBS($ODBC_LIBDIR)
else
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index a15bd02491..4cde406772 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -96,11 +96,11 @@ function_entry odbc_functions[] = {
PHP_FE(odbc_columns, NULL)
PHP_FE(odbc_gettypeinfo, NULL)
PHP_FE(odbc_primarykeys, NULL)
-#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) /* not supported now */
+#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) /* not supported now */
PHP_FE(odbc_columnprivileges, NULL)
PHP_FE(odbc_tableprivileges, NULL)
#endif
-#if !defined(HAVE_SOLID) /* not supported */
+#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) /* not supported */
PHP_FE(odbc_foreignkeys, NULL)
PHP_FE(odbc_procedures, NULL)
PHP_FE(odbc_procedurecolumns, NULL)
@@ -147,7 +147,7 @@ static void _free_odbc_result(odbc_result *res)
res->values = NULL;
}
if (res->stmt) {
-#ifdef HAVE_SOLID
+#if defined(HAVE_SOLID) || defined(HAVE_SOLID_35)
SQLTransact(res->conn_ptr->henv, res->conn_ptr->hdbc,
(UWORD)SQL_COMMIT);
#endif
@@ -1227,7 +1227,7 @@ PHP_FUNCTION(odbc_fetch_into)
}
/* }}} */
-#ifdef HAVE_SOLID
+#ifdef HAVE_SOLID || defined(HAVE_SOLID_35)
PHP_FUNCTION(solid_fetch_prev)
{
odbc_result *result;
@@ -2403,7 +2403,7 @@ PHP_FUNCTION(odbc_columns)
}
/* }}} */
-#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID)
+#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35)
/* {{{ proto int odbc_columnprivileges(int connection_id, string catalog, string schema, string table, string column)
Returns a result identifier that can be used to fetch a list of columns and associated privileges for the specified table */
PHP_FUNCTION(odbc_columnprivileges)
@@ -2483,7 +2483,7 @@ PHP_FUNCTION(odbc_columnprivileges)
/* }}} */
#endif /* HAVE_DBMAKER || HAVE_SOLID*/
-#if !defined(HAVE_SOLID)
+#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35)
/* {{{ proto int odbc_foreignkeys(int connection_id, string pk_qualifier, string pk_owner, string pk_table, string fk_qualifier, string fk_owner, string fk_table)
Returns a result identifier to either a list of foreign keys in the specified table or a list of foreign keys in other tables that refer to the primary key in the specified table */
PHP_FUNCTION(odbc_foreignkeys)
@@ -2730,7 +2730,7 @@ PHP_FUNCTION(odbc_primarykeys)
}
/* }}} */
-#if !defined(HAVE_SOLID)
+#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35)
/* {{{ proto int odbc_procedurecolumns(int connection_id [, string qualifier, string owner, string proc, string column])
Returns a result identifier containing the list of input and output parameters, as well as the columns that make up the result set for the specified procedures */
PHP_FUNCTION(odbc_procedurecolumns)
@@ -2814,7 +2814,7 @@ PHP_FUNCTION(odbc_procedurecolumns)
/* }}} */
#endif /* HAVE_SOLID */
-#if !defined(HAVE_SOLID)
+#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35)
/* {{{ proto int odbc_procedures(int connection_id [, string qualifier, string owner, string name])
Returns a result identifier containg the list of procedure names in a datasource */
PHP_FUNCTION(odbc_procedures)
@@ -3067,7 +3067,7 @@ PHP_FUNCTION(odbc_statistics)
}
/* }}} */
-#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID)
+#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35)
/* {{{ proto int odbc_tableprivileges(int connection_id, string qualifier, string owner, string name)
Returns a result identifier containing a list of tables and the privileges associated with each table */
PHP_FUNCTION(odbc_tableprivileges)
diff --git a/ext/odbc/php_odbc.h b/ext/odbc/php_odbc.h
index 199edc4974..ad87e3c410 100644
--- a/ext/odbc/php_odbc.h
+++ b/ext/odbc/php_odbc.h
@@ -45,11 +45,24 @@
/* checking in the same order as in configure.in */
-#ifdef HAVE_SOLID /* Solid Server */
+#if defined(HAVE_SOLID) || defined(HAVE_SOLID_35) /* Solid Server */
#define ODBC_TYPE "Solid"
-#include <cli0core.h>
-#include <cli0ext1.h>
+#if defined(HAVE_SOLID)
+ #include <cli0core.h>
+ #include <cli0ext1.h>
+ /*the following help for SOLID 3.0 */
+ #include <cli0cli.h>
+ #include <cli0env.h>
+#elif defined(HAVE_SOLID_35)
+ #if !defined(PHP_WIN32)
+ #include <sqlunix.h>
+ #endif
+ #include <sql.h>
+ #include <sqltypes.h>
+ #include <sqlucode.h>
+ #include <sqlext.h>
+#endif
#undef HAVE_SQL_EXTENDED_FETCH
PHP_FUNCTION(solid_fetch_prev);
#define SQLSMALLINT SWORD
@@ -194,11 +207,11 @@ PHP_FUNCTION(odbc_binmode);
PHP_FUNCTION(odbc_longreadlen);
PHP_FUNCTION(odbc_tables);
PHP_FUNCTION(odbc_columns);
-#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) /* not supported now */
+#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) /* not supported now */
PHP_FUNCTION(odbc_columnprivileges);
PHP_FUNCTION(odbc_tableprivileges);
#endif
-#if !defined(HAVE_SOLID) /* not supported */
+#if !defined(HAVE_SOLID) || !defined(HAVE_SOLID_35) /* not supported */
PHP_FUNCTION(odbc_foreignkeys);
PHP_FUNCTION(odbc_procedures);
PHP_FUNCTION(odbc_procedurecolumns);