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