thies Tue Jul 22 06:38:35 2003 EDT Modified files: /php-src/ext/oci8 oci8.c Log: @ - Added optional Parameter to OCIWriteTemporaryLob which allows to @ specify the type of LOB you want to be written (OCI_TEMP_CLOB, OCI_TEMP_BLOB) @ (Patch by Novicky Marek <[EMAIL PROTECTED]>) (Thies) Index: php-src/ext/oci8/oci8.c diff -u php-src/ext/oci8/oci8.c:1.211 php-src/ext/oci8/oci8.c:1.212 --- php-src/ext/oci8/oci8.c:1.211 Sun Jun 22 10:33:03 2003 +++ php-src/ext/oci8/oci8.c Tue Jul 22 06:38:34 2003 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8.c,v 1.211 2003/06/22 14:33:03 andrey Exp $ */ +/* $Id: oci8.c,v 1.212 2003/07/22 10:38:34 thies Exp $ */ /* TODO list: * @@ -560,6 +560,12 @@ REGISTER_LONG_CONSTANT("OCI_D_LOB",OCI_DTYPE_LOB, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OCI_D_ROWID",OCI_DTYPE_ROWID, CONST_CS | CONST_PERSISTENT); +/* for OCIWriteTemporaryLob */ +#ifdef HAVE_OCI8_TEMP_LOB + REGISTER_LONG_CONSTANT("OCI_TEMP_CLOB",OCI_TEMP_CLOB, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OCI_TEMP_BLOB",OCI_TEMP_BLOB, CONST_CS | CONST_PERSISTENT); +#endif + return SUCCESS; } @@ -641,7 +647,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "OCI8 Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.211 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.212 $"); #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 ); @@ -3432,17 +3438,18 @@ /* }}} */ #ifdef HAVE_OCI8_TEMP_LOB -/* {{{ proto bool ociwritetemporarylob(string var) +/* {{{ proto bool ociwritetemporarylob(string var [, int lob_type]) Writes temporary blob */ PHP_FUNCTION(ociwritetemporarylob) { - zval *id, **var; + zval *id, *var; OCILobLocator *mylob; oci_connection *connection; oci_descriptor *descr; ub4 offset = 1; ub4 loblen; + int lob_type = OCI_TEMP_CLOB; oci_debug ("oci_write_temporary_lob"); @@ -3462,11 +3469,10 @@ connection = descr->conn; - if (zend_get_parameters_ex(1, &var) == FAILURE) { - WRONG_PARAM_COUNT; + if (ZEND_NUM_ARGS() < 1) WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &var, &lob_type) == FAILURE) { + RETURN_FALSE; } - /* is this convert needed - done again below */ - convert_to_string_ex(var); CALL_OCI_RETURN(connection->error, OCILobCreateTemporary( connection->pServiceContext, @@ -3474,7 +3480,7 @@ mylob, OCI_DEFAULT, OCI_DEFAULT, - OCI_TEMP_CLOB, + lob_type, OCI_ATTR_NOCACHE, OCI_DURATION_SESSION)); @@ -3496,8 +3502,8 @@ RETURN_FALSE; } - convert_to_string_ex(var); - loblen = Z_STRLEN_PP(var); + convert_to_string_ex(&var); + loblen = Z_STRLEN_P(var); if (loblen < 1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot save a lob that is less than 1 byte"); @@ -3510,7 +3516,7 @@ mylob, (ub4 *) &loblen, (ub4) offset, - (dvoid *) Z_STRVAL_PP(var), + (dvoid *) Z_STRVAL_P(var), (ub4) loblen, OCI_ONE_PIECE, (dvoid *)0,
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php