Re: cvs: php4 /ext/oci8 config.m4 oci8.c php_oci8.h

From: Date: Fri, 06 Dec 2002 14:37:19 +0000
Subject: Re: cvs: php4 /ext/oci8 config.m4 oci8.c php_oci8.h
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-16971@lists.php.net to get a copy of this message
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


« previous php.cvs (#16971) next »