cvs: php4 /ext/pgsql pgsql.c

From: Date: Sat, 24 Aug 2002 22:28:28 +0000
Subject: cvs: php4 /ext/pgsql pgsql.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13648@lists.php.net to get a copy of this message
yohgaki Sat Aug 24 18:28:28 2002 EDT Modified files: /php4/ext/pgsql pgsql.c Log: Changed pg_connection_info()/pg_connection_reset()/pg_connection_busy()/pg_result_status()/pg_result_error() silently return FALSE when resource is not passed to them. @ Changed pg_connection_info()/pg_connection_reset()/pg_connection_busy()/pg_result_status()/pg_result_error() silently return FALSE when resource is not passed to them. (Yasuo) Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.216 php4/ext/pgsql/pgsql.c:1.217 --- php4/ext/pgsql/pgsql.c:1.216 Sat Aug 24 03:19:40 2002 +++ php4/ext/pgsql/pgsql.c Sat Aug 24 18:28:28 2002 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pgsql.c,v 1.216 2002/08/24 07:19:40 yohgaki Exp $ */ +/* $Id: pgsql.c,v 1.217 2002/08/24 22:28:28 yohgaki Exp $ */ #include <stdlib.h> @@ -2598,9 +2598,9 @@ pgsql_result_handle *pg_result; char *err = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", - &result) == FAILURE) { - return; + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", + &result) == FAILURE) { + RETURN_FALSE; } ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); @@ -2622,9 +2622,9 @@ int id = -1; PGconn *pgsql; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", - &pgsql_link) == FAILURE) { - return; + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", + &pgsql_link) == FAILURE) { + RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -2642,9 +2642,9 @@ int id = -1; PGconn *pgsql; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", - &pgsql_link) == FAILURE) { - return; + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", + &pgsql_link) == FAILURE) { + RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -2691,9 +2691,9 @@ PGconn *pgsql; PGresult *pgsql_result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", - &pgsql_link) == FAILURE) { - return; + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", + &pgsql_link) == FAILURE) { + RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -2799,9 +2799,9 @@ PGresult *pgsql_result; pgsql_result_handle *pg_result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", - &pgsql_link) == FAILURE) { - return; + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", + &pgsql_link) == FAILURE) { + RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -2830,13 +2830,7 @@ pgsql_result_handle *pg_result; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r|l", - &result, &result_type) == SUCCESS) { - } - else { - if (Z_TYPE_P(result) != IS_RESOURCE) - RETURN_FALSE; - php_error(E_WARNING,"%s expects parameter 1 to be resource and 2 to be integer", - get_active_function_name(TSRMLS_C)); + &result, &result_type) == FAILURE) { RETURN_FALSE; }

« previous php.cvs (#13648) next »