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

2011-10-31 Thread Christopher Jones
sixd Mon, 31 Oct 2011 20:48:25 +

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

Log:
OCI8: improve initialization error message (See bug 60154)

Bug: https://bugs.php.net/60154 (Bogus) OCIEnvNlsCreate() failed. please check 
that LD_LIBRARY_PATH includes ...
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/branches/PHP_5_4/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.c2011-10-31 19:34:59 UTC 
(rev 318618)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-10-31 20:48:25 UTC 
(rev 318619)
@@ -79,11 +79,14 @@
 #endif

 /* 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
+#elif defined(_AIX)
+#define PHP_OCI8_LIB_PATH_MSG LIBPATH
+#elif defined(__hpux)
+#define PHP_OCI8_LIB_PATH_MSG SHLIB_PATH
 #else
 #define PHP_OCI8_LIB_PATH_MSG LD_LIBRARY_PATH
 #endif

Modified: php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-10-31 19:34:59 UTC 
(rev 318618)
+++ php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-10-31 20:48:25 UTC 
(rev 318619)
@@ -79,11 +79,14 @@
 #endif

 /* 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
+#elif defined(_AIX)
+#define PHP_OCI8_LIB_PATH_MSG LIBPATH
+#elif defined(__hpux)
+#define PHP_OCI8_LIB_PATH_MSG SHLIB_PATH
 #else
 #define PHP_OCI8_LIB_PATH_MSG LD_LIBRARY_PATH
 #endif

Modified: php/php-src/trunk/ext/oci8/oci8.c
===
--- php/php-src/trunk/ext/oci8/oci8.c   2011-10-31 19:34:59 UTC (rev 318618)
+++ php/php-src/trunk/ext/oci8/oci8.c   2011-10-31 20:48:25 UTC (rev 318619)
@@ -79,11 +79,14 @@
 #endif

 /* 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
+#elif defined(_AIX)
+#define PHP_OCI8_LIB_PATH_MSG LIBPATH
+#elif defined(__hpux)
+#define PHP_OCI8_LIB_PATH_MSG SHLIB_PATH
 #else
 #define PHP_OCI8_LIB_PATH_MSG LD_LIBRARY_PATH
 #endif

-- 
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 branches/PHP_5_4/ext/oci8/oci8.c trunk/ext/oci8/oci8.c

2011-07-25 Thread Christopher Jones
sixd Mon, 25 Jul 2011 17:30:09 +

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

Log:
Patch r313663 and r313665 to allow PECL builds to work with earlier releases

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/branches/PHP_5_4/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.c2011-07-25 17:25:47 UTC 
(rev 313680)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-07-25 17:30:09 UTC 
(rev 313681)
@@ -937,7 +937,11 @@
PHP_FALIAS(ocicollsize, oci_collection_size,
arginfo_oci_collection_size)
PHP_FALIAS(ocicollmax,  oci_collection_max, 
arginfo_oci_collection_max)
PHP_FALIAS(ocicolltrim, oci_collection_trim,
arginfo_oci_collection_trim)
+#if (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION == 3  PHP_RELEASE_VERSION 
= 7) || (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION = 4) || 
(PHP_MAJOR_VERSION  5)
PHP_FE_END
+#else
+   {NULL,NULL,NULL}
+#endif
 };

 static
@@ -968,7 +972,11 @@
PHP_FALIAS(save,oci_lob_save,   
arginfo_oci_lob_save_method)
PHP_FALIAS(savefile,oci_lob_import, 
arginfo_oci_lob_import_method)
PHP_FALIAS(free,oci_free_descriptor,
arginfo_oci_free_descriptor_method)
+#if (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION == 3  PHP_RELEASE_VERSION 
= 7) || (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION = 4) || 
(PHP_MAJOR_VERSION  5)
PHP_FE_END
+#else
+   {NULL,NULL,NULL}
+#endif
 };

 static
@@ -985,7 +993,11 @@
PHP_FALIAS(max,   oci_collection_max,   
arginfo_oci_collection_max_method)
PHP_FALIAS(trim,  oci_collection_trim,  
arginfo_oci_collection_trim_method)
PHP_FALIAS(free,  oci_free_collection,  
arginfo_oci_collection_free_method)
+#if (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION == 3  PHP_RELEASE_VERSION 
= 7) || (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION = 4) || 
(PHP_MAJOR_VERSION  5)
PHP_FE_END
+#else
+   {NULL,NULL,NULL}
+#endif
 };

 zend_module_entry oci8_module_entry = {

Modified: php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-07-25 17:25:47 UTC 
(rev 313680)
+++ php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-07-25 17:30:09 UTC 
(rev 313681)
@@ -937,7 +937,11 @@
PHP_FALIAS(ocicollsize, oci_collection_size,
arginfo_oci_collection_size)
PHP_FALIAS(ocicollmax,  oci_collection_max, 
arginfo_oci_collection_max)
PHP_FALIAS(ocicolltrim, oci_collection_trim,
arginfo_oci_collection_trim)
+#if (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION == 3  PHP_RELEASE_VERSION 
= 7) || (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION = 4) || 
(PHP_MAJOR_VERSION  5)
PHP_FE_END
+#else
+   {NULL,NULL,NULL}
+#endif
 };

 static
@@ -968,7 +972,11 @@
PHP_FALIAS(save,oci_lob_save,   
arginfo_oci_lob_save_method)
PHP_FALIAS(savefile,oci_lob_import, 
arginfo_oci_lob_import_method)
PHP_FALIAS(free,oci_free_descriptor,
arginfo_oci_free_descriptor_method)
+#if (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION == 3  PHP_RELEASE_VERSION 
= 7) || (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION = 4) || 
(PHP_MAJOR_VERSION  5)
PHP_FE_END
+#else
+   {NULL,NULL,NULL}
+#endif
 };

 static
@@ -985,7 +993,11 @@
PHP_FALIAS(max,   oci_collection_max,   
arginfo_oci_collection_max_method)
PHP_FALIAS(trim,  oci_collection_trim,  
arginfo_oci_collection_trim_method)
PHP_FALIAS(free,  oci_free_collection,  
arginfo_oci_collection_free_method)
+#if (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION == 3  PHP_RELEASE_VERSION 
= 7) || (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION = 4) || 
(PHP_MAJOR_VERSION  5)
PHP_FE_END
+#else
+   {NULL,NULL,NULL}
+#endif
 };

 zend_module_entry oci8_module_entry = {

Modified: php/php-src/trunk/ext/oci8/oci8.c
===
--- php/php-src/trunk/ext/oci8/oci8.c   2011-07-25 17:25:47 UTC (rev 313680)
+++ php/php-src/trunk/ext/oci8/oci8.c   2011-07-25 17:30:09 UTC (rev 313681)
@@ -937,7 +937,11 @@
PHP_FALIAS(ocicollsize, oci_collection_size,
arginfo_oci_collection_size)
PHP_FALIAS(ocicollmax,  

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

2011-07-25 Thread Christopher Jones
sixd Mon, 25 Jul 2011 23:40:57 +

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

Log:
Fix cast warning seen on some platforms

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/branches/PHP_5_4/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.c2011-07-25 21:39:53 UTC 
(rev 313687)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-07-25 23:40:57 UTC 
(rev 313688)
@@ -37,6 +37,13 @@
 #include php_ini.h
 #include ext/standard/php_smart_str.h

+#ifdef HAVE_STDINT_H
+#include stdint.h
+#endif
+#ifdef PHP_WIN32
+#include win32/php_stdint.h
+#endif
+
 #if HAVE_OCI8

 #if PHP_MAJOR_VERSION  5
@@ -51,6 +58,14 @@
 #include php_oci8_int.h
 #include zend_hash.h

+#if defined(HAVE_STDINT_H) || defined(PHP_WIN32)
+#define OCI8_INT_TO_PTR(I)  ((void *)(intptr_t)(I))
+#define OCI8_PTR_TO_INT(P)  ((int)(intptr_t)(P))
+#else
+#define OCI8_INT_TO_PTR(I)  ((void *)(I))
+#define OCI8_PTR_TO_INT(P)  ((int)(P))
+#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 */
@@ -1877,7 +1892,7 @@
int type, link;
void *ptr;

-   link = (int) le-ptr;
+   link = OCI8_PTR_TO_INT(le-ptr);
ptr = zend_list_find(link,type);
if (ptr  (type == le_connection)) {
connection = (php_oci_connection *)ptr;
@@ -2116,7 +2131,7 @@
 #else
connection-rsrc_id = zend_list_insert(connection, 
le_connection);
 #endif
-   new_le.ptr = (void *)connection-rsrc_id;
+   new_le.ptr = OCI8_INT_TO_PTR(connection-rsrc_id);
new_le.type = le_index_ptr;
zend_hash_update(EG(regular_list), connection-hash_key, 
strlen(connection-hash_key)+1, (void *)new_le, sizeof(zend_rsrc_list_entry), 
NULL);
OCI_G(num_links)++;

Modified: php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-07-25 21:39:53 UTC 
(rev 313687)
+++ php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-07-25 23:40:57 UTC 
(rev 313688)
@@ -37,6 +37,13 @@
 #include php_ini.h
 #include ext/standard/php_smart_str.h

+#ifdef HAVE_STDINT_H
+#include stdint.h
+#endif
+#ifdef PHP_WIN32
+#include win32/php_stdint.h
+#endif
+
 #if HAVE_OCI8

 #if PHP_MAJOR_VERSION  5
@@ -51,6 +58,14 @@
 #include php_oci8_int.h
 #include zend_hash.h

+#if defined(HAVE_STDINT_H) || defined(PHP_WIN32)
+#define OCI8_INT_TO_PTR(I)  ((void *)(intptr_t)(I))
+#define OCI8_PTR_TO_INT(P)  ((int)(intptr_t)(P))
+#else
+#define OCI8_INT_TO_PTR(I)  ((void *)(I))
+#define OCI8_PTR_TO_INT(P)  ((int)(P))
+#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 */
@@ -1877,7 +1892,7 @@
int type, link;
void *ptr;

-   link = (int) le-ptr;
+   link = OCI8_PTR_TO_INT(le-ptr);
ptr = zend_list_find(link,type);
if (ptr  (type == le_connection)) {
connection = (php_oci_connection *)ptr;
@@ -2116,7 +2131,7 @@
 #else
connection-rsrc_id = zend_list_insert(connection, 
le_connection);
 #endif
-   new_le.ptr = (void *)connection-rsrc_id;
+   new_le.ptr = OCI8_INT_TO_PTR(connection-rsrc_id);
new_le.type = le_index_ptr;
zend_hash_update(EG(regular_list), connection-hash_key, 
strlen(connection-hash_key)+1, (void *)new_le, sizeof(zend_rsrc_list_entry), 
NULL);
OCI_G(num_links)++;

Modified: php/php-src/trunk/ext/oci8/oci8.c
===
--- php/php-src/trunk/ext/oci8/oci8.c   2011-07-25 21:39:53 UTC (rev 313687)
+++ php/php-src/trunk/ext/oci8/oci8.c   2011-07-25 23:40:57 UTC (rev 313688)
@@ -37,6 +37,13 @@
 #include php_ini.h
 #include ext/standard/php_smart_str.h

+#ifdef HAVE_STDINT_H
+#include stdint.h
+#endif
+#ifdef PHP_WIN32
+#include win32/php_stdint.h
+#endif
+
 #if HAVE_OCI8

 #if PHP_MAJOR_VERSION  5
@@ -51,6 +58,14 @@
 #include php_oci8_int.h
 #include zend_hash.h

+#if defined(HAVE_STDINT_H) || defined(PHP_WIN32)
+#define OCI8_INT_TO_PTR(I)  ((void *)(intptr_t)(I))
+#define 

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

2011-06-10 Thread Christopher Jones
sixd Sat, 11 Jun 2011 00:24:26 +

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

Log:
Fix TSRMLS for Windows build

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/oci8.c
U   php/php-src/branches/PHP_5_4/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.c2011-06-11 00:16:37 UTC 
(rev 312038)
+++ php/php-src/branches/PHP_5_3/ext/oci8/oci8.c2011-06-11 00:24:26 UTC 
(rev 312039)
@@ -1314,7 +1314,7 @@
php_info_print_table_row(2, Active Connections, buf);

 #if ((OCI_MAJOR_VERSION  10) || ((OCI_MAJOR_VERSION == 10)  
(OCI_MINOR_VERSION = 2)))
-   php_oci_client_get_version(ver TSRMLS_DC);
+   php_oci_client_get_version(ver TSRMLS_CC);
php_info_print_table_row(2, Oracle Run-time Client Library Version, 
ver);
efree(ver);
 #endif

Modified: php/php-src/branches/PHP_5_4/ext/oci8/oci8.c
===
--- php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-06-11 00:16:37 UTC 
(rev 312038)
+++ php/php-src/branches/PHP_5_4/ext/oci8/oci8.c2011-06-11 00:24:26 UTC 
(rev 312039)
@@ -1314,7 +1314,7 @@
php_info_print_table_row(2, Active Connections, buf);

 #if ((OCI_MAJOR_VERSION  10) || ((OCI_MAJOR_VERSION == 10)  
(OCI_MINOR_VERSION = 2)))
-   php_oci_client_get_version(ver TSRMLS_DC);
+   php_oci_client_get_version(ver TSRMLS_CC);
php_info_print_table_row(2, Oracle Run-time Client Library Version, 
ver);
efree(ver);
 #endif

Modified: php/php-src/trunk/ext/oci8/oci8.c
===
--- php/php-src/trunk/ext/oci8/oci8.c   2011-06-11 00:16:37 UTC (rev 312038)
+++ php/php-src/trunk/ext/oci8/oci8.c   2011-06-11 00:24:26 UTC (rev 312039)
@@ -1314,7 +1314,7 @@
php_info_print_table_row(2, Active Connections, buf);

 #if ((OCI_MAJOR_VERSION  10) || ((OCI_MAJOR_VERSION == 10)  
(OCI_MINOR_VERSION = 2)))
-   php_oci_client_get_version(ver TSRMLS_DC);
+   php_oci_client_get_version(ver TSRMLS_CC);
php_info_print_table_row(2, Oracle Run-time Client Library Version, 
ver);
efree(ver);
 #endif

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