diff options
author | Christopher Jones <sixd@php.net> | 2008-03-25 02:00:32 +0000 |
---|---|---|
committer | Christopher Jones <sixd@php.net> | 2008-03-25 02:00:32 +0000 |
commit | ceb2193b7caf90a3246b13123dd044b511fdc05a (patch) | |
tree | fd23343e2a51c6c2cd7be763b01f640f628326d2 /ext/oci8 | |
parent | 16f6918e0f698623d3de984e44c9ff5d281e2225 (diff) | |
download | php-git-ceb2193b7caf90a3246b13123dd044b511fdc05a.tar.gz |
rename PHP_OCI8_VERSION in preparation for peclversioning RFC. Remove obsolete HAVE_OCI8_ATTR_STATEMENT macro
Diffstat (limited to 'ext/oci8')
-rw-r--r-- | ext/oci8/config.m4 | 53 | ||||
-rw-r--r-- | ext/oci8/config.w32 | 3 | ||||
-rw-r--r-- | ext/oci8/oci8.c | 6 | ||||
-rw-r--r-- | ext/oci8/oci8_interface.c | 6 | ||||
-rw-r--r-- | ext/oci8/php_oci8.h | 6 | ||||
-rw-r--r-- | ext/oci8/php_oci8_int.h | 2 |
6 files changed, 32 insertions, 44 deletions
diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4 index 6cfb167ede..062972c07f 100644 --- a/ext/oci8/config.m4 +++ b/ext/oci8/config.m4 @@ -55,7 +55,7 @@ AC_DEFUN([AC_OCI8IC_VERSION],[ if test ! -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME; then AC_MSG_ERROR([Link from $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME to libclntsh.$SHLIB_SUFFIX_NAME.11.1 not found]) fi - OCI8_VERSION=11.1 + OCI8_ORACLE_VERSION=11.1 else AC_MSG_ERROR([Oracle Instant Client library version not supported]) fi @@ -64,42 +64,42 @@ AC_DEFUN([AC_OCI8IC_VERSION],[ if test ! -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME; then AC_MSG_ERROR([Link from $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME to libclntsh.$SHLIB_SUFFIX_NAME.10.1 not found]) fi - OCI8_VERSION=10.1 + OCI8_ORACLE_VERSION=10.1 else AC_MSG_ERROR([Oracle Instant Client library version not supported]) fi else AC_MSG_ERROR([Oracle Instant Client libraries not found]) fi - AC_MSG_RESULT([$OCI8_VERSION]) + AC_MSG_RESULT([$OCI8_ORACLE_VERSION]) ]) -AC_DEFUN([AC_OCI8_VERSION],[ +AC_DEFUN([AC_OCI8_ORACLE_VERSION],[ AC_MSG_CHECKING([Oracle version]) if test -s "$OCI8_DIR/orainst/unix.rgs"; then - OCI8_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | $PHP_OCI8_SED 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4` - test -z "$OCI8_VERSION" && OCI8_VERSION=7.3 + OCI8_ORACLE_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | $PHP_OCI8_SED 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4` + test -z "$OCI8_ORACLE_VERSION" && OCI8_ORACLE_VERSION=7.3 elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then - OCI8_VERSION=11.1 + OCI8_ORACLE_VERSION=11.1 elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then - OCI8_VERSION=10.1 + OCI8_ORACLE_VERSION=10.1 elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then - OCI8_VERSION=9.0 + OCI8_ORACLE_VERSION=9.0 elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then - OCI8_VERSION=8.1 + OCI8_ORACLE_VERSION=8.1 elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.1.0; then - OCI8_VERSION=8.0 + OCI8_ORACLE_VERSION=8.0 elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.a; then if test -f $OCI8_DIR/$OCI8_LIB_DIR/libcore4.a; then - OCI8_VERSION=8.0 + OCI8_ORACLE_VERSION=8.0 else - OCI8_VERSION=8.1 + OCI8_ORACLE_VERSION=8.1 fi else AC_MSG_ERROR(Oracle-OCI8 needed libraries not found) fi - AC_MSG_RESULT($OCI8_VERSION) + AC_MSG_RESULT($OCI8_ORACLE_VERSION) ]) @@ -200,21 +200,16 @@ if test "$PHP_OCI8" != "no" && test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then PHP_EVAL_LIBLINE(`cat $OCI8_DIR/rdbms/$OCI8_LIB_DIR/sysliblist`, OCI8_SYSLIB) fi - AC_OCI8_VERSION($OCI8_DIR) + AC_OCI8_ORACLE_VERSION($OCI8_DIR) - case $OCI8_VERSION in - 8.0) - AC_MSG_ERROR([Oracle client libraries < 9.0 are not supported any more. Please consider upgrading.]) - ;; - - 8.1) + case $OCI8_ORACLE_VERSION in + 7.3|8.0|8.1) AC_MSG_ERROR([Oracle client libraries < 9.0 are not supported any more. Please consider upgrading.]) ;; 9.0) PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) PHP_ADD_LIBPATH($OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD) - AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ]) dnl These functions are only available in version >= 9.2 PHP_CHECK_LIBRARY(clntsh, OCIEnvNlsCreate, @@ -222,7 +217,7 @@ if test "$PHP_OCI8" != "no" && test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then PHP_CHECK_LIBRARY(clntsh, OCINlsCharSetNameToId, [ AC_DEFINE(HAVE_OCI_ENV_NLS_CREATE,1,[ ]) - OCI8_VERSION=9.2 + OCI8_ORACLE_VERSION=9.2 ], [], [ -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD ]) @@ -250,13 +245,11 @@ if test "$PHP_OCI8" != "no" && test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then ], [], [ -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD ]) - ;; 11.1|10.1) PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) PHP_ADD_LIBPATH($OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD) - AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ]) AC_DEFINE(HAVE_OCI_ENV_NLS_CREATE,1,[ ]) AC_DEFINE(HAVE_OCI_ENV_CREATE,1,[ ]) AC_DEFINE(HAVE_OCI_STMT_PREPARE2,1,[ ]) @@ -264,8 +257,9 @@ if test "$PHP_OCI8" != "no" && test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ]) AC_DEFINE(PHP_OCI8_HAVE_COLLECTIONS,1,[ ]) ;; + *) - AC_MSG_ERROR([Oracle version $OCI8_VERSION is not supported]) + AC_MSG_ERROR([Oracle version $OCI8_ORACLE_VERSION is not supported]) ;; esac @@ -306,7 +300,7 @@ if test "$PHP_OCI8" != "no" && test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then PHP_SUBST_OLD(OCI8_SHARED_LIBADD) PHP_SUBST_OLD(OCI8_DIR) - PHP_SUBST_OLD(OCI8_VERSION) + PHP_SUBST_OLD(OCI8_ORACLE_VERSION) elif test "$PHP_OCI8" != "no" && test "$PHP_OCI8_INSTANT_CLIENT" != "no"; then @@ -364,7 +358,7 @@ dnl Header directory for manual installation fi AC_OCI8IC_VERSION($PHP_OCI8_INSTANT_CLIENT) - case $OCI8_VERSION in + case $OCI8_ORACLE_VERSION in 11.1|10.1) PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) PHP_ADD_LIBPATH($PHP_OCI8_INSTANT_CLIENT, OCI8_SHARED_LIBADD) @@ -376,7 +370,6 @@ dnl Header directory for manual installation esac AC_DEFINE(HAVE_OCI_INSTANT_CLIENT,1,[ ]) - AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ]) AC_DEFINE(HAVE_OCI_ENV_NLS_CREATE,1,[ ]) AC_DEFINE(HAVE_OCI_ENV_CREATE,1,[ ]) AC_DEFINE(HAVE_OCI_STMT_PREPARE2,1,[ ]) @@ -389,6 +382,6 @@ dnl Header directory for manual installation PHP_SUBST_OLD(OCI8_SHARED_LIBADD) PHP_SUBST_OLD(OCI8_DIR) - PHP_SUBST_OLD(OCI8_VERSION) + PHP_SUBST_OLD(OCI8_ORACLE_VERSION) fi diff --git a/ext/oci8/config.w32 b/ext/oci8/config.w32 index 38d1eadf4e..bf92afcbae 100644 --- a/ext/oci8/config.w32 +++ b/ext/oci8/config.w32 @@ -13,7 +13,6 @@ if (PHP_OCI8 != "no") { AC_DEFINE('HAVE_OCI8', 1); AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1); - AC_DEFINE('HAVE_OCI8_ATTR_STATEMENT', 1); AC_DEFINE('HAVE_OCI_ENV_NLS_CREATE', 1); AC_DEFINE('HAVE_OCI_ENV_CREATE', 1); AC_DEFINE('HAVE_OCI_STMT_PREPARE2', 1); @@ -22,7 +21,7 @@ if (PHP_OCI8 != "no") { AC_DEFINE('PHP_OCI8_HAVE_COLLECTIONS', 1); } else { - WARNING("oci8 not enabled; libraries and headers not found"); + WARNING("oci8 not enabled; Oracle Database libraries or Oracle 10g Instant Client not found"); } } diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index fea537934f..1fe9c48303 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -715,7 +715,7 @@ PHP_MINFO_FUNCTION(oci) php_info_print_table_start(); php_info_print_table_row(2, "OCI8 Support", "enabled"); - php_info_print_table_row(2, "Version", "1.3.1 Beta"); + php_info_print_table_row(2, "Version", PHP_OCI8_VERSION); php_info_print_table_row(2, "Revision", "$Revision$"); snprintf(buf, sizeof(buf), "%ld", OCI_G(num_persistent)); @@ -724,7 +724,7 @@ PHP_MINFO_FUNCTION(oci) php_info_print_table_row(2, "Active Connections", buf); #if !defined(PHP_WIN32) && !defined(HAVE_OCI_INSTANT_CLIENT) - php_info_print_table_row(2, "Oracle Version", PHP_OCI8_VERSION ); + php_info_print_table_row(2, "Oracle Version", PHP_OCI8_ORACLE_VERSION ); php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_OCI8_DIR ); php_info_print_table_row(2, "Libraries Used", PHP_OCI8_SHARED_LIBADD ); #else @@ -1019,7 +1019,6 @@ sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf TSRMLS_DC) return error_code; } /* }}} */ -#ifdef HAVE_OCI8_ATTR_STATEMENT /* {{{ php_oci_fetch_sqltext_offset() Compute offset in the SQL statement */ int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset TSRMLS_DC) @@ -1044,7 +1043,6 @@ int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, u } return 0; } /* }}} */ -#endif /* {{{ php_oci_do_connect() Connect wrapper */ diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c index 40efb9ce0c..be343584d8 100644 --- a/ext/oci8/oci8_interface.c +++ b/ext/oci8/oci8_interface.c @@ -1598,10 +1598,8 @@ PHP_FUNCTION(oci_error) sb4 errcode = 0; sword error = OCI_SUCCESS; dvoid *errh = NULL; -#ifdef HAVE_OCI8_ATTR_STATEMENT ub2 error_offset = 0; text *sqltext = NULL; -#endif if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg) == FAILURE) { return; @@ -1614,11 +1612,9 @@ PHP_FUNCTION(oci_error) errh = statement->err; error = statement->errcode; -#ifdef HAVE_OCI8_ATTR_STATEMENT if (php_oci_fetch_sqltext_offset(statement, &sqltext, &error_offset TSRMLS_CC)) { RETURN_FALSE; } -#endif goto go_out; } @@ -1656,10 +1652,8 @@ go_out: array_init(return_value); add_assoc_long(return_value, "code", errcode); add_assoc_string(return_value, "message", (char*) errbuf, 0); -#ifdef HAVE_OCI8_ATTR_STATEMENT add_assoc_long(return_value, "offset", error_offset); add_assoc_string(return_value, "sqltext", sqltext ? (char *) sqltext : "", 1); -#endif } else { RETURN_FALSE; } diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h index 80301773b2..9058aacb7e 100644 --- a/ext/oci8/php_oci8.h +++ b/ext/oci8/php_oci8.h @@ -35,6 +35,12 @@ # include "TSRM.h" #endif + +/* + * The version of the OCI8 extension. + */ +#define PHP_OCI8_VERSION "1.3.1 Beta" + extern zend_module_entry oci8_module_entry; #define phpext_oci8_ptr &oci8_module_entry diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h index a80dcf6b2f..2331f08fa9 100644 --- a/ext/oci8/php_oci8_int.h +++ b/ext/oci8/php_oci8_int.h @@ -349,9 +349,7 @@ int php_oci_descriptor_delete_from_hash(void *data, void *id TSRMLS_DC); sb4 php_oci_error (OCIError *, sword TSRMLS_DC); sb4 php_oci_fetch_errmsg(OCIError *, text ** TSRMLS_DC); -#ifdef HAVE_OCI8_ATTR_STATEMENT int php_oci_fetch_sqltext_offset(php_oci_statement *, text **, ub2 * TSRMLS_DC); -#endif void php_oci_do_connect (INTERNAL_FUNCTION_PARAMETERS, int , int); php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC); |