Re: cvs: php4 /ext/pgsql pgsql.c
| From: | Yasuo Ohgaki | Date: | Thu, 25 Apr 2002 06:55:04 +0000 |
| Subject: | Re: cvs: php4 /ext/pgsql pgsql.c | ||
| References: | 1 2 3 4 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-11424@lists.php.net to get a copy of this message | ||
Markus Fischer wrote:
Sounds reasonable. I'll keep your advice in my mind when I update the doc. -- Yasuo OhgakiHi,I see the dilemma here. But I don't think it's a good idea to remove the optional argument as long as it is still accepted (it is somehow inconsistent for me) from the prototype.I think the proper way would be to document what the problem is, as you stated it, in the pg_fetch_object() manual page. As long as we don't remove the argument from the code, we cannot just silently alter the prototype. We need to document that this argument does not make much sense but has been kept for backwards compatibility.Does this sound reasonable?
- MarkusOn Thu, Apr 25, 2002 at 02:45:22PM +0900, Yasuo Ohgaki wrote :Markus Fischer wrote:Hi, does this mean that the result_type parameter, which was introduced in version 4.0.0, is deprecated as of now and will be removed in a future version > 4.3.0 ?No. It will be stay there for existing scripts. This is the reason for this change. pg_fetch_object() used to return object that has properties named by field number & field name. However, numeric name is not allowed in PHP. User has no way to access numerically named properties. It was just wasting memory. I've changed code so that default for 3rd parameter became PGSQL_ASSOC. If user ommit 3rd parameter, OLD: pg_fetch_object($db, 10, PGSQL_BOTH); NEW: pg_fetch_object($db, 10, PGSQL_ASSOC); User can specify 3rd parameter even if PGSQL_BOTH or PGSQL_NUM for it does not make sense. Any scripts will not be affected by this change. (Unless we change PHP_FUNCTION(pg_fetch_object), I'll add comment to prevent other person accidentally modify the way it is now) -- Yasuo Ohgaki- Markus On Wed, Apr 24, 2002 at 11:03:58PM -0000, Yasuo Ohgaki wrote :-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpyohgaki Wed Apr 24 19:03:58 2002 EDTModified files: /php4/ext/pgsql pgsql.c Log:Remove result_type from pg_fetch_object() proto. It still accepts 3rd argument, but passing 3rd argument does not make sense for pg_fetch_object(). Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.195 php4/ext/pgsql/pgsql.c:1.196 --- php4/ext/pgsql/pgsql.c:1.195 Wed Apr 24 18:57:21 2002 +++ php4/ext/pgsql/pgsql.c Wed Apr 24 19:03:48 2002 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pgsql.c,v 1.195 2002/04/24 22:57:21 yohgaki Exp $ */ +/* $Id: pgsql.c,v 1.196 2002/04/24 23:03:48 yohgaki Exp $ */ #include <stdlib.h> @@ -1343,7 +1343,7 @@ } /* }}} */ -/* {{{ proto object pg_fetch_object(resource result [, int row [, int result_type]]) +/* {{{ proto object pg_fetch_object(resource result [, int row]) Fetch a row as an object */ PHP_FUNCTION(pg_fetch_object) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php