[PHP-CVS] cvs: php4 /ext/oci8 config.m4 oci8.c
ldixon Tue Jan 7 10:56:00 2003 EDT Modified files: /php4/ext/oci8 config.m4 oci8.c Log: Added support for Shared Data Mode for OCI8_VERSION = 8.1, which will provide memory savings by sharing common statement data Index: php4/ext/oci8/config.m4 diff -u php4/ext/oci8/config.m4:1.39 php4/ext/oci8/config.m4:1.40 --- php4/ext/oci8/config.m4:1.39Fri Dec 6 13:25:39 2002 +++ php4/ext/oci8/config.m4 Tue Jan 7 10:55:59 2003 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.39 2002/12/06 18:25:39 moriyoshi Exp $ +dnl $Id: config.m4,v 1.40 2003/01/07 15:55:59 ldixon Exp $ dnl AC_DEFUN(AC_OCI8_VERSION,[ @@ -74,6 +74,7 @@ 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 @@ 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,[ ]) ;; Index: php4/ext/oci8/oci8.c diff -u php4/ext/oci8/oci8.c:1.197 php4/ext/oci8/oci8.c:1.198 --- php4/ext/oci8/oci8.c:1.197 Tue Dec 31 11:07:06 2002 +++ php4/ext/oci8/oci8.cTue Jan 7 10:55:59 2003 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: oci8.c,v 1.197 2002/12/31 16:07:06 sebastian Exp $ */ +/* $Id: oci8.c,v 1.198 2003/01/07 15:55:59 ldixon Exp $ */ /* TODO list: * @@ -464,12 +464,24 @@ 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 @@ -628,7 +640,7 @@ php_info_print_table_start(); php_info_print_table_row(2, OCI8 Support, enabled); - php_info_print_table_row(2, Revision, $Revision: 1.197 $); + php_info_print_table_row(2, Revision, $Revision: 1.198 $); #ifndef PHP_WIN32 php_info_print_table_row(2, Oracle Version, PHP_OCI8_VERSION ); php_info_print_table_row(2, Compile-time ORACLE_HOME, PHP_OCI8_DIR ); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/oci8 config.m4 oci8.c php_oci8.h
abonamous Fri Dec 6 08:44:35 2002 EDT Modified files: /php4/ext/oci8 config.m4 oci8.c php_oci8.h Log: added support for multiple character sets. OCILogon now has a forth optional parameter, which is the character set requested by the string (i.e. we8iso8859p1). when left blank, NLS_LANG or default is used. config.m4 was changed to identify Oracle 9+ which is needed for this feature. all other oracle versions (lesser) fall back to the old behaviour. Index: php4/ext/oci8/config.m4 diff -u php4/ext/oci8/config.m4:1.37 php4/ext/oci8/config.m4:1.38 --- php4/ext/oci8/config.m4:1.37Mon Sep 9 15:03:51 2002 +++ php4/ext/oci8/config.m4 Fri Dec 6 08:44:35 2002 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.37 2002/09/09 19:03:51 kalowsky Exp $ +dnl $Id: config.m4,v 1.38 2002/12/06 13:44:35 abonamous Exp $ dnl AC_DEFUN(AC_OCI8_VERSION,[ @@ -66,7 +66,7 @@ PHP_ADD_LIBRARY_WITH_PATH(clntsh, $OCI8_DIR/lib, OCI8_SHARED_LIBADD) ;; -8.1|9.0) +8.1) PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) if test -f $OCI8_DIR/lib/libocijdbc8.so ; then PHP_ADD_LIBRARY(ocijdbc8, 1, OCI8_SHARED_LIBADD) @@ -74,6 +74,17 @@ PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD) AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ]) AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ]) + ;; + +9.0) + PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) + if test -f $OCI8_DIR/lib/libocijdbc8.so ; then +PHP_ADD_LIBRARY(ocijdbc8, 1, OCI8_SHARED_LIBADD) + fi + 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_OCI9,1,[]) ;; *) Index: php4/ext/oci8/oci8.c diff -u php4/ext/oci8/oci8.c:1.193 php4/ext/oci8/oci8.c:1.194 --- php4/ext/oci8/oci8.c:1.193 Mon Nov 25 13:14:45 2002 +++ php4/ext/oci8/oci8.cFri Dec 6 08:44:35 2002 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: oci8.c,v 1.193 2002/11/25 18:14:45 maxim Exp $ */ +/* $Id: oci8.c,v 1.194 2002/12/06 13:44:35 abonamous Exp $ */ /* TODO list: * @@ -194,7 +194,7 @@ static oci_server *_oci_open_server(char *dbname,int persistent); static void _oci_close_server(oci_server *server); -static oci_session *_oci_open_session(oci_server* server,char *username,char *password,int persistent,int exclusive); +static oci_session *_oci_open_session(oci_server* server,char *username,char +*password,int persistent,int exclusive, char *charset); static void _oci_close_session(oci_session *session); static sb4 oci_bind_in_callback(dvoid *, OCIBind *, ub4, ub4, dvoid **, ub4 *, ub1 *, dvoid **); @@ -628,7 +628,7 @@ php_info_print_table_start(); php_info_print_table_row(2, OCI8 Support, enabled); - php_info_print_table_row(2, Revision, $Revision: 1.193 $); + php_info_print_table_row(2, Revision, $Revision: 1.194 $); #ifndef PHP_WIN32 php_info_print_table_row(2, Oracle Version, PHP_OCI8_VERSION ); php_info_print_table_row(2, Compile-time ORACLE_HOME, PHP_OCI8_DIR ); @@ -1157,7 +1157,7 @@ } CALL_OCI_RETURN(OCI(error), OCIDescriptorAlloc( - OCI(pEnv), + connection-session-pEnv, (dvoid*)(descr-ocidescr), Z_TYPE_P(descr), (size_t) 0, @@ -1348,14 +1348,14 @@ statement = ecalloc(1,sizeof(oci_statement)); CALL_OCI(OCIHandleAlloc( - OCI(pEnv), + connection-session-pEnv, (dvoid **)statement-pStmt, OCI_HTYPE_STMT, 0, NULL)); CALL_OCI(OCIHandleAlloc( - OCI(pEnv), + connection-session-pEnv, (dvoid **)statement-pError, OCI_HTYPE_ERROR, 0, @@ -1902,7 +1902,7 @@ readlen, /* size of buffer */ (dvoid *)0, (OCICallbackLobRead) 0, /* callback... */ - (ub2) 0, /* The character set ID of the buffer data. */ + (ub2) connection-session-charsetId, + /* The character set ID of the buffer data. */ (ub1) SQLCS_IMPLICIT)); /* The character set form of the buffer data. */ siz += readlen; @@ -2123,11 +2123,12 @@
Re: [PHP-CVS] cvs: php4 /ext/oci8 config.m4 oci8.c php_oci8.h
In oci_do_connect() you simply changed the number of allowed parameters. What about guarding the 4th parameter by a define and emit a warning or error when using this with a version that does not support this parameter (e.g. 9)? And you could use zend_parse_parameters() to have better code. Maybe you like this (s means retireve a string parameter, | means rest is optional): char *userParam, *passParam, *dbParam, *charParam; int charParam_len, dbParam_len, passParam_len, userParam_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, sss|s, userParam, userParam_len, passParam, passParam_len, dbParam, dbParam_len, charParam, charParam_len) == FAILURE) { RETURN_FALSE; } #ifndef HAVE_OCI9 if (ZEND_NUM_ARGS()==4) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Charset parameter only supported by OCI9 and above); } #endif /*HAVE_OCI9*/ regards marcus At 14:44 06.12.2002, Abdul-Kareem Abo-Namous wrote: abonamous Fri Dec 6 08:44:35 2002 EDT Modified files: /php4/ext/oci8 config.m4 oci8.c php_oci8.h Log: added support for multiple character sets. OCILogon now has a forth optional parameter, which is the character set requested by the string (i.e. we8iso8859p1). when left blank, NLS_LANG or default is used. config.m4 was changed to identify Oracle 9+ which is needed for this feature. all other oracle versions (lesser) fall back to the old behaviour. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/oci8 config.m4 oci8.c php_oci8.h
good idea, but i will use ss|ss since both last parameters are optional. besides, a warning should be enough since with oracle v8 the fourth parameter is simply unused. regards, abdul - Original Message - From: Marcus Börger [EMAIL PROTECTED] To: Abdul-Kareem Abo-Namous [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, December 06, 2002 3:37 PM Subject: Re: [PHP-CVS] cvs: php4 /ext/oci8 config.m4 oci8.c php_oci8.h In oci_do_connect() you simply changed the number of allowed parameters. What about guarding the 4th parameter by a define and emit a warning or error when using this with a version that does not support this parameter (e.g. 9)? And you could use zend_parse_parameters() to have better code. Maybe you like this (s means retireve a string parameter, | means rest is optional): char *userParam, *passParam, *dbParam, *charParam; int charParam_len, dbParam_len, passParam_len, userParam_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, sss|s, userParam, userParam_len, passParam, passParam_len, dbParam, dbParam_len, charParam, charParam_len) == FAILURE) { RETURN_FALSE; } #ifndef HAVE_OCI9 if (ZEND_NUM_ARGS()==4) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Charset parameter only supported by OCI9 and above); } #endif /*HAVE_OCI9*/ regards marcus At 14:44 06.12.2002, Abdul-Kareem Abo-Namous wrote: abonamous Fri Dec 6 08:44:35 2002 EDT Modified files: /php4/ext/oci8 config.m4 oci8.c php_oci8.h Log: added support for multiple character sets. OCILogon now has a forth optional parameter, which is the character set requested by the string (i.e. we8iso8859p1). when left blank, NLS_LANG or default is used. config.m4 was changed to identify Oracle 9+ which is needed for this feature. all other oracle versions (lesser) fall back to the old behaviour. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php