Re: cvs: php4 /ext/pgsql pgsql.c
| From: | derick@php.net | Date: | Sat, 24 Aug 2002 22:44:44 +0000 |
| Subject: | Re: cvs: php4 /ext/pgsql pgsql.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-13649@lists.php.net to get a copy of this message | ||
On Sat, 24 Aug 2002, Yasuo Ohgaki wrote:
> 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)
Why would you want that?
Derick
>
>
> 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;
> }
>
>
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
---------------------------------------------------------------------------
Did I help you? http://www.derickrethans.nl/link.php?url=giftlist
Frequent ranting: http://www.derickrethans.nl/
---------------------------------------------------------------------------
PHP: Scripting the Web - derick@php.net
All your branches are belong to me!
SRM: Script Running Machine - www.vl-srm.net
---------------------------------------------------------------------------