Index: oci8.c =================================================================== RCS file: /repository/pecl/oci8/oci8.c,v retrieving revision 1.269.2.16.2.37 diff -u -p -d -r1.269.2.16.2.37 oci8.c --- oci8.c 6 Aug 2007 20:32:54 -0000 1.269.2.16.2.37 +++ oci8.c 23 Oct 2007 23:33:24 -0000 @@ -399,6 +399,7 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("oci8.statement_cache_size", "20", PHP_INI_SYSTEM, ONUPDATELONGFUNC, statement_cache_size, zend_oci_globals, oci_globals) STD_PHP_INI_ENTRY("oci8.default_prefetch", "10", PHP_INI_SYSTEM, ONUPDATELONGFUNC, default_prefetch, zend_oci_globals, oci_globals) STD_PHP_INI_ENTRY("oci8.old_oci_close_semantics", "0", PHP_INI_SYSTEM, OnUpdateBool, old_oci_close_semantics, zend_oci_globals, oci_globals) + STD_PHP_INI_BOOLEAN("oci8.use_ociping", "0", PHP_INI_SYSTEM, OnUpdateBool, use_ociping, zend_oci_globals, oci_globals) PHP_INI_END() /* }}} */ @@ -1426,17 +1427,18 @@ open: /* }}} */ /* {{{ php_oci_connection_ping() - * Ping connection. Uses OCIPing() or OCIServerVersion() depending on the Oracle Client version */ + * Ping connection. Uses OCIPing() or OCIServerVersion() depending on the use_ociping flag */ static int php_oci_connection_ping(php_oci_connection *connection TSRMLS_DC) { - /* OCIPing() crashes Oracle servers older than 10.2 */ -#if 0 - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPing, (connection->svc, OCI_G(err), OCI_DEFAULT)); -#else - char version[256]; - /* use good old OCIServerVersion() by default */ - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIServerVersion, (connection->server, OCI_G(err), (text*)version, sizeof(version), OCI_HTYPE_SERVER)); -#endif + if (OCI_G(use_ociping)) { + /* OCIPing() crashes Oracle servers older than 10.2 */ + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPing, (connection->svc, OCI_G(err), OCI_DEFAULT)); + } else { + char version[256]; + + /* use good old OCIServerVersion() by default */ + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIServerVersion, (connection->server, OCI_G(err), (text*)version, sizeof(version), OCI_HTYPE_SERVER)); + } if (OCI_G(errcode) == OCI_SUCCESS) { return 1; Index: php_oci8_int.h =================================================================== RCS file: /repository/pecl/oci8/php_oci8_int.h,v retrieving revision 1.11.2.6.2.21 diff -u -p -d -r1.11.2.6.2.21 php_oci8_int.h --- php_oci8_int.h 6 Aug 2007 20:32:55 -0000 1.11.2.6.2.21 +++ php_oci8_int.h 23 Oct 2007 23:33:24 -0000 @@ -429,6 +429,7 @@ ZEND_BEGIN_MODULE_GLOBALS(oci) /* {{{ */ long default_prefetch; /* default prefetch setting */ zend_bool privileged_connect; /* privileged connect flag (On/Off) */ zend_bool old_oci_close_semantics; /* old_oci_close_semantics flag (to determine the way oci_close() should behave) */ + zend_bool use_ociping; /* use OCIPing() flag (crashes Oracle servers older than 10.2) */ int shutdown; /* in shutdown flag */