[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/oci8/oci8.c trunk/ext/oci8/oci8.c

2010-11-10 Thread Christopher Jones
sixd Wed, 10 Nov 2010 18:59:56 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=305257

Log:
Improve startup failure error messages

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/trunk/ext/oci8/oci8.c

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2010-11-10 18:49:55 UTC 
(rev 305256)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2010-11-10 18:59:56 UTC 
(rev 305257)
@@ -1040,6 +1040,12 @@
 #else
php_error_docref(NULL TSRMLS_CC, E_WARNING, OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that 
ORACLE_HOME and  PHP_OCI8_LIB_PATH_MSG  are set and point to the right 
directories);
 #endif
+   if (OCI_G(env)
+OCIErrorGet(OCI_G(env), (ub4)1, NULL, 
ora_error_code, tmp_buf, (ub4)PHP_OCI_ERRBUF_LEN, (ub4)OCI_HTYPE_ENV) == 
OCI_SUCCESS
+*tmp_buf) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, %s, 
tmp_buf);
+   }
+
OCI_G(env) = NULL;
OCI_G(err) = NULL;
return;

Modified: php/php-src/trunk/ext/oci8/oci8.c
===
--- php/php-src/trunk/ext/oci8/oci8.c   2010-11-10 18:49:55 UTC (rev 305256)
+++ php/php-src/trunk/ext/oci8/oci8.c   2010-11-10 18:59:56 UTC (rev 305257)
@@ -1040,6 +1040,12 @@
 #else
php_error_docref(NULL TSRMLS_CC, E_WARNING, OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that 
ORACLE_HOME and  PHP_OCI8_LIB_PATH_MSG  are set and point to the right 
directories);
 #endif
+   if (OCI_G(env)
+OCIErrorGet(OCI_G(env), (ub4)1, NULL, 
ora_error_code, tmp_buf, (ub4)PHP_OCI_ERRBUF_LEN, (ub4)OCI_HTYPE_ENV) == 
OCI_SUCCESS
+*tmp_buf) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, %s, 
tmp_buf);
+   }
+
OCI_G(env) = NULL;
OCI_G(err) = NULL;
return;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/oci8/oci8.c trunk/ext/oci8/oci8.c

2010-06-25 Thread Christopher Jones
sixd Fri, 25 Jun 2010 21:09:13 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=300752

Log:
Fix bug #52186 (phpinfo shows 10.1 or 11.1 when installed with ORACLE_HOME 10.2 
or 11.2)

Bug: http://bugs.php.net/52186 (Assigned) phpinfo() shows 10.1 or 11.1 when 
installed with ORACLE_HOME 10.2 or 11.2
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/trunk/ext/oci8/oci8.c

Modified: php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2010-06-25 18:23:54 UTC 
(rev 300751)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2010-06-25 21:09:13 UTC 
(rev 300752)
@@ -1300,19 +1300,26 @@
snprintf(buf, sizeof(buf), %ld, OCI_G(num_links));
php_info_print_table_row(2, Active Connections, buf);

+#ifdefined(OCI_MAJOR_VERSION)  defined(OCI_MINOR_VERSION)
+   snprintf(buf, sizeof(buf), %d.%d, OCI_MAJOR_VERSION, 
OCI_MINOR_VERSION);
+#elif defined(PHP_OCI8_ORACLE_VERSION)
+   snprintf(buf, sizeof(buf), %s, PHP_OCI8_ORACLE_VERSION);
+#else
+   snprintf(buf, sizeof(buf), Unknown);
+#endif
+#if defined(HAVE_OCI_INSTANT_CLIENT)
+   php_info_print_table_row(2, Oracle Instant Client Version, buf);
+#else
+   php_info_print_table_row(2, Oracle Version, buf);
+#endif
+
 #if !defined(PHP_WIN32)  !defined(HAVE_OCI_INSTANT_CLIENT)
-#ifdef PHP_OCI8_ORACLE_VERSION
-   php_info_print_table_row(2, Oracle Version, PHP_OCI8_ORACLE_VERSION);
-#endif
-#ifdef PHP_OCI8_DEF_DIR
+#if defined(PHP_OCI8_DEF_DIR)
php_info_print_table_row(2, Compile-time ORACLE_HOME, 
PHP_OCI8_DEF_DIR);
 #endif
-#ifdef PHP_OCI8_DEF_SHARED_LIBADD
+#if defined(PHP_OCI8_DEF_SHARED_LIBADD)
php_info_print_table_row(2, Libraries Used, 
PHP_OCI8_DEF_SHARED_LIBADD);
 #endif
-#elif defined(HAVE_OCI_INSTANT_CLIENT)  defined(OCI_MAJOR_VERSION)  
defined(OCI_MINOR_VERSION)
-   snprintf(buf, sizeof(buf), %d.%d, OCI_MAJOR_VERSION, 
OCI_MINOR_VERSION);
-   php_info_print_table_row(2, Oracle Instant Client Version, buf);
 #endif

php_info_print_table_row(2, Temporary Lob support, enabled);

Modified: php/php-src/trunk/ext/oci8/oci8.c
===
--- php/php-src/trunk/ext/oci8/oci8.c   2010-06-25 18:23:54 UTC (rev 300751)
+++ php/php-src/trunk/ext/oci8/oci8.c   2010-06-25 21:09:13 UTC (rev 300752)
@@ -1300,19 +1300,26 @@
snprintf(buf, sizeof(buf), %ld, OCI_G(num_links));
php_info_print_table_row(2, Active Connections, buf);

+#ifdefined(OCI_MAJOR_VERSION)  defined(OCI_MINOR_VERSION)
+   snprintf(buf, sizeof(buf), %d.%d, OCI_MAJOR_VERSION, 
OCI_MINOR_VERSION);
+#elif defined(PHP_OCI8_ORACLE_VERSION)
+   snprintf(buf, sizeof(buf), %s, PHP_OCI8_ORACLE_VERSION);
+#else
+   snprintf(buf, sizeof(buf), Unknown);
+#endif
+#if defined(HAVE_OCI_INSTANT_CLIENT)
+   php_info_print_table_row(2, Oracle Instant Client Version, buf);
+#else
+   php_info_print_table_row(2, Oracle Version, buf);
+#endif
+
 #if !defined(PHP_WIN32)  !defined(HAVE_OCI_INSTANT_CLIENT)
-#ifdef PHP_OCI8_ORACLE_VERSION
-   php_info_print_table_row(2, Oracle Version, PHP_OCI8_ORACLE_VERSION);
-#endif
-#ifdef PHP_OCI8_DEF_DIR
+#if defined(PHP_OCI8_DEF_DIR)
php_info_print_table_row(2, Compile-time ORACLE_HOME, 
PHP_OCI8_DEF_DIR);
 #endif
-#ifdef PHP_OCI8_DEF_SHARED_LIBADD
+#if defined(PHP_OCI8_DEF_SHARED_LIBADD)
php_info_print_table_row(2, Libraries Used, 
PHP_OCI8_DEF_SHARED_LIBADD);
 #endif
-#elif defined(HAVE_OCI_INSTANT_CLIENT)  defined(OCI_MAJOR_VERSION)  
defined(OCI_MINOR_VERSION)
-   snprintf(buf, sizeof(buf), %d.%d, OCI_MAJOR_VERSION, 
OCI_MINOR_VERSION);
-   php_info_print_table_row(2, Oracle Instant Client Version, buf);
 #endif

php_info_print_table_row(2, Temporary Lob support, enabled);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php