IFS=$ac_IFS
oci8_php_version=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
- if test "$oci8_php_version" -lt "4003009"; then
- AC_MSG_ERROR([You need at least PHP 4.3.9 to be able to use this version of OCI8. PHP $php_version found])
+ if test "$oci8_php_version" -lt "5002000"; then
+ AC_MSG_ERROR([You need at least PHP 5.2.0 to be able to use this version of OCI8. PHP $php_version found])
else
AC_MSG_RESULT([$php_version, ok])
fi
AC_OCI8_ORACLE_VERSION($OCI8_DIR)
case $OCI8_ORACLE_VERSION in
- 7.3|8.0|8.1)
- AC_MSG_ERROR([Oracle client libraries < 9.2 are not supported])
- ;;
-
- 9.0)
- PHP_CHECK_LIBRARY(clntsh, OCIEnvNlsCreate,
- [
- OCI8_ORACLE_VERSION=9.2
- ],
- [
- AC_MSG_ERROR([Oracle client libraries < 9.2 are not supported])
- ], [
- -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD
- ])
- ;;
-
- *)
- AC_DEFINE(HAVE_OCI_LOB_READ2,1,[Defined to 1 if OCI8 configuration located Oracle's OCILobRead2 function])
+ 7.3|8.0|8.1|9.0)
+ AC_MSG_ERROR([Oracle client libraries < 10 are not supported])
;;
esac
PHP_ADD_LIBPATH($PHP_OCI8_INSTANT_CLIENT, OCI8_SHARED_LIBADD)
AC_DEFINE(HAVE_OCI_INSTANT_CLIENT,1,[Defined to 1 if OCI8 configuration located Oracle's Instant Client libraries])
- AC_DEFINE(HAVE_OCI_LOB_READ2,1,[Defined to 1 if OCI8 configuration located Oracle's OCILobRead2 function])
PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c, $ext_shared)
AC_DEFINE(HAVE_OCI8,1,[Defined to 1 if the PHP OCI8 extension for Oracle Database is configured])
AC_DEFINE('HAVE_OCI8', 1);
AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
- AC_DEFINE('HAVE_OCI_LOB_READ2', 1);
-
} else {
WARNING("oci8-12c not enabled: Oracle Database client libraries or Oracle Database 12c Instant Client not found");
PHP_OCI8_12C = "no"
#if HAVE_OCI8
-#if PHP_MAJOR_VERSION > 5
-#error This version of the PHP OCI8 extension is not compatible with PHP 6 or later
-#elif PHP_MAJOR_VERSION < 5
-#ifdef ZTS
-#error The PHP OCI8 extension does not support ZTS mode in PHP 4
-#endif
+/* PHP 5.2 is the minimum supported version for OCI8 2.0 */
+#if PHP_MAJOR_VERSION < 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION <= 1)
+#error Use PHP OCI8 1.4 for your version of PHP
#endif
#include "php_oci8.h"
#endif
ZEND_DECLARE_MODULE_GLOBALS(oci)
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
-/* This "if" allows PECL builds from this file to be portable to older PHP releases */
static PHP_GINIT_FUNCTION(oci);
static PHP_GSHUTDOWN_FUNCTION(oci);
-#endif
/* Allow PHP 5.3 branch to be used in PECL for 5.x compatible builds */
#ifndef Z_ADDREF_P
PHP_RSHUTDOWN(oci), /* per-request shutdown function */
PHP_MINFO(oci), /* information function */
PHP_OCI8_VERSION,
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
- /* This check allows PECL builds from this file to be portable to older PHP releases */
PHP_MODULE_GLOBALS(oci), /* globals descriptor */
PHP_GINIT(oci), /* globals ctor */
PHP_GSHUTDOWN(oci), /* globals dtor */
NULL, /* post deactivate */
STANDARD_MODULE_PROPERTIES_EX
-#else
- STANDARD_MODULE_PROPERTIES
-#endif
};
/* }}} */
*
* Zerofill globals during module init
*/
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
-/* This check allows PECL builds from this file to be portable to older PHP releases */
static PHP_GINIT_FUNCTION(oci)
-#else
-static void php_oci_init_globals(zend_oci_globals *oci_globals TSRMLS_DC)
-#endif
{
memset(oci_globals, 0, sizeof(zend_oci_globals));
}
*
* Called for thread shutdown in ZTS, after module shutdown for non-ZTS
*/
-/* This check allows PECL builds from this file to be portable to older PHP releases */
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
static PHP_GSHUTDOWN_FUNCTION(oci)
-#else
-static void php_oci_shutdown_globals(zend_oci_globals *oci_globals TSRMLS_DC)
-#endif
{
php_oci_cleanup_global_handles(TSRMLS_C);
}
zend_class_entry oci_lob_class_entry;
zend_class_entry oci_coll_class_entry;
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
- /* This check allows PECL builds from this file to be portable to older PHP releases */
- /* this is handled by new globals management code */
-#else
- ZEND_INIT_MODULE_GLOBALS(oci, php_oci_init_globals, php_oci_shutdown_globals);
-#endif
REGISTER_INI_ENTRIES();
le_statement = zend_register_list_destructors_ex(php_oci_statement_list_dtor, NULL, "oci8 statement", module_number);
PHP_MSHUTDOWN_FUNCTION(oci)
{
-/* Work around PHP_GSHUTDOWN_FUNCTION not being called in older versions of PHP */
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 2) || (PHP_MAJOR_VERSION < 5)
-#ifndef ZTS
- php_oci_cleanup_global_handles(TSRMLS_C);
-#endif
-#endif
-
OCI_G(shutdown) = 1;
UNREGISTER_INI_ENTRIES();
php_oci_connection *connection = collection->connection;
sword errstatus;
-#if (PHP_MAJOR_VERSION == 4 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION < 10)
- /* minimum PHP version ext/oci8/config.m4 accepts is 4.3.9 */
- element_double = strtod(number, NULL);
-#else
- /* zend_strtod was introduced in PHP 4.3.10 */
element_double = zend_strtod(number, NULL);
-#endif
PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number));
php_oci_connection *connection = collection->connection;
sword errstatus;
-#if (PHP_MAJOR_VERSION == 4 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION < 10)
- /* minimum PHP version ext/oci8/config.m4 accepts is 4.3.9 */
- element_double = strtod(number, NULL);
-#else
- /* zend_strtod was introduced in PHP 4.3.10 */
element_double = zend_strtod(number, NULL);
-#endif
PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number));
if (flags & PHP_OCI_NUM) {
zend_hash_next_index_insert(Z_ARRVAL_P(row), &element, sizeof(zval*), NULL);
} else { /* default to ASSOC */
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
- /* zend_symtable_update is only available in 5.2+ */
zend_symtable_update(Z_ARRVAL_P(row), columns[ i ]->name, columns[ i ]->name_len+1, &element, sizeof(zval*), NULL);
-#else
- /* This code path means Bug #45458 will remain broken when OCI8 is built with PHP 4 */
- zend_hash_update(Z_ARRVAL_P(row), columns[ i ]->name, columns[ i ]->name_len+1, &element, sizeof(zval*), NULL);
-#endif
}
}
MAKE_STD_ZVAL(tmp);
array_init(tmp);
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
- /* zend_symtable_update is only available in 5.2+ */
zend_symtable_update(Z_ARRVAL_P(array), columns[ i ]->name, columns[ i ]->name_len+1, (void *) &tmp, sizeof(zval*), (void **) &(outarrs[ i ]));
-#else
- /* This code path means Bug #45458 will remain broken when OCI8 is built with PHP 4 */
- zend_hash_update(Z_ARRVAL_P(array), columns[ i ]->name, columns[ i ]->name_len+1, (void *) &tmp, sizeof(zval*), (void **) &(outarrs[ i ]));
-#endif
}
}
/* {{{ php_oci_lob_callback()
Append LOB portion to a memory buffer */
-#if defined(HAVE_OCI_LOB_READ2)
sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece, dvoid **changed_bufpp, oraub8 *changed_lenp)
-#else
-sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, ub4 len, ub1 piece)
-#endif
{
ub4 lenp = (ub4) len;
php_oci_lob_ctx *ctx = (php_oci_lob_ctx *)ctxp;
int buffer_size = PHP_OCI_LOB_BUFFER_SIZE;
php_oci_lob_ctx ctx;
ub1 *bufp;
-#if defined(HAVE_OCI_LOB_READ2)
oraub8 bytes_read, offset = 0;
oraub8 requested_len = read_length; /* this is by default */
oraub8 chars_read = 0;
-#else
- int bytes_read, offset = 0;
- int requested_len = read_length; /* this is by default */
-#endif
int is_clob = 0;
sb4 bytes_per_char = 1;
sword errstatus;
ctx.alloc_len = (requested_len + 1) * bytes_per_char;
*data = ecalloc(bytes_per_char, requested_len + 1);
-#ifdef HAVE_OCI_LOB_READ2
if (is_clob) {
chars_read = requested_len;
bytes_read = 0;
} else {
offset = descriptor->lob_current_position + bytes_read;
}
-
-#else
-
- bytes_read = requested_len;
- buffer_size = (requested_len < buffer_size ) ? requested_len : buffer_size; /* optimize buffer size */
- buffer_size = php_oci_lob_calculate_buffer(descriptor, buffer_size TSRMLS_CC); /* use chunk size */
-
- bufp = (ub1 *) ecalloc(1, buffer_size);
- PHP_OCI_CALL_RETURN(errstatus, OCILobRead,
- (
- connection->svc,
- connection->err,
- descriptor->descriptor,
- &bytes_read, /* IN/OUT bytes toread/read */
- offset + 1, /* offset (starts with 1) */
- (dvoid *) bufp,
- (ub4) buffer_size, /* size of buffer */
- (dvoid *)&ctx,
- (OCICallbackLobRead) php_oci_lob_callback, /* callback... */
- (ub2) descriptor->charset_id, /* The character set ID of the buffer data. */
- (ub1) descriptor->charset_form /* The character set form of the buffer data. */
- )
- );
-
- efree(bufp);
- offset = descriptor->lob_current_position + bytes_read;
-
-#endif
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
<summary>Extension for Oracle Database</summary>
<description>
- This extension allows you to access Oracle Database. OCI8 2.0 can
- be built with PHP 4.3.9 onwards. OCI8 can be linked with Oracle
- Database 9.2, 10, 11, or 12.1 client libraries. Oracle's standard
- cross-version connectivity applies. For example PHP linked with
- Oracle Database 11.2 client libraries can connect to Oracle
- Database 9.2 onwards.
+The PHP OCI8 extension gives access to Oracle Database. The extension
+can be linked with Oracle client libraries from Oracle Database 10.2,
+11, or 12.1. These libraries are found in the database installation,
+or in the free Oracle Instant Client. Oracle's standard cross-version
+connectivity applies. For example, PHP OCI8 linked with Instant
+Client 11.2 can connect to Oracle Database 9.2 onwards. PHP OCI8 2.0
+can be built with PHP 5.2 onwards. Use the older PHP OCI8 1.4.10 when
+using PHP 4.3.9 through to PHP 5.1.x, or when only Oracle Database 9.2
+client libraries are available.
</description>
<lead>
<name>Christopher Jones</name>
<active>no</active>
</lead>
- <date>2013-09-27</date>
+ <date>2013-10-08</date>
<time>12:00:00</time>
<version>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
- - no notes yet
+Bump mininum requirements for PHP OCI8 2.0 to PHP 5.2 and Oracle
+client library 10.2 (Note this will connect to Oracle Database 8.1.7
+onwards). Use the older OCI8 1.4 if an earlier PHP version or older
+Oracle client library support is necessary.
</notes>
<contents>
<dir name="/">
<dependencies>
<required>
<php>
- <min>4.3.9</min>
- <max>6.0.0</max>
+ <min>5.2.0</min>
</php>
<pearinstaller>
<min>1.4.0b1</min>
int php_oci_lob_truncate(php_oci_descriptor *descriptor, long new_lob_length TSRMLS_DC);
int php_oci_lob_erase(php_oci_descriptor *descriptor, long offset, ub4 length, ub4 *bytes_erased TSRMLS_DC);
int php_oci_lob_is_equal(php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result TSRMLS_DC);
-#if defined(HAVE_OCI_LOB_READ2)
sb4 php_oci_lob_callback(dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece, dvoid **changed_bufpp, oraub8 *changed_lenp);
-#else
-sb4 php_oci_lob_callback(dvoid *ctxp, CONST dvoid *bufxp, ub4 len, ub1 piece);
-#endif
/* }}} */
/* {{{ collection related prototypes */