sixd            Mon Mar 16 05:29:49 2009 UTC

  Modified files:              
    /php-src/ext/oci8   oci8.c 
    /php-src/ext/oci8/tests     connect_without_oracle_home.phpt 
                                connect_without_oracle_home_old.phpt 
                                pecl_bug16035.phpt 
  Log:
  Mac OSX customization for initialization error message
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.363&r2=1.364&diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.363 php-src/ext/oci8/oci8.c:1.364
--- php-src/ext/oci8/oci8.c:1.363       Mon Mar  9 20:07:39 2009
+++ php-src/ext/oci8/oci8.c     Mon Mar 16 05:29:48 2009
@@ -26,7 +26,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: oci8.c,v 1.363 2009/03/09 20:07:39 sixd Exp $ */
+/* $Id: oci8.c,v 1.364 2009/03/16 05:29:48 sixd Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -51,6 +51,16 @@
 static PHP_GINIT_FUNCTION(oci);
 static PHP_GSHUTDOWN_FUNCTION(oci);
 
+/* For a user friendly message about environment setup */
+/* TODO: add cases for SHLIB_PATH, LIBPATH, LD_LIBRARY_PATH_64 etc */
+#if defined(PHP_WIN32)
+#define PHP_OCI8_LIB_PATH_MSG "PATH"
+#elif defined(__APPLE__)
+#define PHP_OCI8_LIB_PATH_MSG "DYLD_LIBRARY_PATH"
+#else
+#define PHP_OCI8_LIB_PATH_MSG "LD_LIBRARY_PATH"
+#endif
+
 /* True globals, no need for thread safety */
 int le_connection;
 int le_pconnection;
@@ -852,13 +862,9 @@
 
        if (errstatus == OCI_ERROR) {
 #ifdef HAVE_OCI_INSTANT_CLIENT
-# ifdef PHP_WIN32
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that PATH 
includes the directory with Oracle Instant Client libraries");
-# else
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that 
LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries");
-# endif
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that " 
PHP_OCI8_LIB_PATH_MSG " includes the directory with Oracle Instant Client 
libraries");
 #else
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that 
ORACLE_HOME is set and points to the right directory");
+               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
                OCI_G(env) = NULL;
                OCI_G(err) = NULL;
@@ -1084,7 +1090,7 @@
        php_info_print_table_start();
        php_info_print_table_row(2, "OCI8 Support", "enabled");
        php_info_print_table_row(2, "Version", PHP_OCI8_VERSION);
-       php_info_print_table_row(2, "Revision", "$Revision: 1.363 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.364 $");
 
        snprintf(buf, sizeof(buf), "%ld", OCI_G(num_persistent));
        php_info_print_table_row(2, "Active Persistent Connections", buf);
@@ -2599,14 +2605,11 @@
        PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIEnvNlsCreate, (&retenv, 
OCI_G(events) ? PHP_OCI_INIT_MODE | OCI_EVENTS : PHP_OCI_INIT_MODE, 0, NULL, 
NULL, NULL, 0, NULL, charsetid, charsetid));
 
        if (OCI_G(errcode) != OCI_SUCCESS) {
+
 #ifdef HAVE_OCI_INSTANT_CLIENT
-# ifdef PHP_WIN32
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that PATH 
includes the directory with Oracle Instant Client libraries");
-# else
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that 
LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries");
-# endif
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that " 
PHP_OCI8_LIB_PATH_MSG " includes the directory with Oracle Instant Client 
libraries");
 #else
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() 
failed. There is something wrong with your system - please check that 
ORACLE_HOME is set and points to the right directory");
+               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
                return NULL;
        }
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/connect_without_oracle_home.phpt?r1=1.6&r2=1.7&diff_format=u
Index: php-src/ext/oci8/tests/connect_without_oracle_home.phpt
diff -u php-src/ext/oci8/tests/connect_without_oracle_home.phpt:1.6 
php-src/ext/oci8/tests/connect_without_oracle_home.phpt:1.7
--- php-src/ext/oci8/tests/connect_without_oracle_home.phpt:1.6 Thu Mar 12 
14:47:47 2009
+++ php-src/ext/oci8/tests/connect_without_oracle_home.phpt     Mon Mar 16 
05:29:49 2009
@@ -31,6 +31,6 @@
 ===DONE===
 <?php exit(0); ?>
 --EXPECTF--
-Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong 
with your system - please check that ORACLE_HOME is set and points to the right 
directory in %s on line %d
+Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong 
with your system - please check that ORACLE_HOME and %s are set and point to 
the right directories in %s on line %d
 bool(false)
 ===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/connect_without_oracle_home_old.phpt?r1=1.6&r2=1.7&diff_format=u
Index: php-src/ext/oci8/tests/connect_without_oracle_home_old.phpt
diff -u php-src/ext/oci8/tests/connect_without_oracle_home_old.phpt:1.6 
php-src/ext/oci8/tests/connect_without_oracle_home_old.phpt:1.7
--- php-src/ext/oci8/tests/connect_without_oracle_home_old.phpt:1.6     Thu Mar 
12 14:47:47 2009
+++ php-src/ext/oci8/tests/connect_without_oracle_home_old.phpt Mon Mar 16 
05:29:49 2009
@@ -31,6 +31,6 @@
 ===DONE===
 <?php exit(0); ?>
 --EXPECTF--
-Warning: ocilogon(): OCIEnvNlsCreate() failed. There is something wrong with 
your system - please check that ORACLE_HOME is set and points to the right 
directory in %s on line %d
+Warning: ocilogon(): OCIEnvNlsCreate() failed. There is something wrong with 
your system - please check that ORACLE_HOME and %s are set and point to the 
right directories in %s on line %d
 bool(false)
 ===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/pecl_bug16035.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/oci8/tests/pecl_bug16035.phpt
diff -u php-src/ext/oci8/tests/pecl_bug16035.phpt:1.2 
php-src/ext/oci8/tests/pecl_bug16035.phpt:1.3
--- php-src/ext/oci8/tests/pecl_bug16035.phpt:1.2       Thu Mar 12 14:47:47 2009
+++ php-src/ext/oci8/tests/pecl_bug16035.phpt   Mon Mar 16 05:29:49 2009
@@ -23,5 +23,5 @@
 ===DONE===
 <?php exit(0); ?>
 --EXPECTF--
-Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong 
with your system - please check that ORACLE_HOME is set and points to the right 
directory in %s on line %d
+Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong 
with your system - please check that ORACLE_HOME and %s are set and point to 
the right directories in %s on line %d
 ===DONE===



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

Reply via email to