summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/oci8/config.m42
-rw-r--r--ext/oci8/oci8.c12
2 files changed, 14 insertions, 0 deletions
diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4
index 6ea4fc1c3a..626b5ce59c 100644
--- a/ext/oci8/config.m4
+++ b/ext/oci8/config.m4
@@ -74,6 +74,7 @@ if test "$PHP_OCI8" != "no"; then
PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD)
AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ])
AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ])
+ AC_DEFINE(HAVE_OCI8_SHARED_MODE,1,[ ])
;;
9.0)
@@ -84,6 +85,7 @@ if test "$PHP_OCI8" != "no"; then
PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD)
AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ])
AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ])
+ AC_DEFINE(HAVE_OCI8_SHARED_MODE,1,[ ])
AC_DEFINE(HAVE_OCI9,1,[ ])
;;
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 3a14bb4aeb..a63474ee25 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -464,12 +464,24 @@ PHP_MINIT_FUNCTION(oci)
zend_class_entry oci_coll_class_entry;
#endif
+#ifdef HAVE_OCI8_SHARED_MODE
+
+#ifdef WITH_COLLECTIONS
+#define PHP_OCI_INIT_MODE OCI_SHARED | OCI_OBJECT
+#else
+#define PHP_OCI_INIT_MODE OCI_SHARED
+#endif
+
+#else
+
#ifdef WITH_COLLECTIONS
#define PHP_OCI_INIT_MODE OCI_DEFAULT | OCI_OBJECT
#else
#define PHP_OCI_INIT_MODE OCI_DEFAULT
#endif
+#endif
+
#if OCI_USE_EMALLOC
OCIInitialize(PHP_OCI_INIT_MODE, NULL, ocimalloc, ocirealloc, ocifree);
#else