[PHP-CVS] cvs: php4 / NEWS
yohgaki Mon Sep 30 22:54:31 2002 EDT Modified files: /php4 NEWS Log: Implicit flush fix Index: php4/NEWS diff -u php4/NEWS:1.1162 php4/NEWS:1.1163 --- php4/NEWS:1.1162Mon Sep 30 21:40:07 2002 +++ php4/NEWS Mon Sep 30 22:54:30 2002 @@ -4,6 +4,7 @@ - ATTENTION!! "make install" will *always* install the CLI SAPI binary in {PREFIX}/bin/php. If you enable the CGI binary to be built, it will be installed as {PREFIX}/bin/php-cgi. +- Fixed output buffering implicit flush. (Yasuo) - Added getopt() for parsing command line options and arguments. (Jon) - Added pg_fetch_assoc(), pg_fetch_all(), pg_metadata(), pg_convert(), pg_insert(), pg_select(), pg_update() and pg_delete(). (Yasuo) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / configure.in
sniper Mon Sep 30 22:47:52 2002 EDT Modified files: /php4 configure.in Log: - Revert the removal of dlopen check here. # Left HAVE_LIBDL undefined for some reason Index: php4/configure.in diff -u php4/configure.in:1.375 php4/configure.in:1.376 --- php4/configure.in:1.375 Mon Sep 30 21:47:08 2002 +++ php4/configure.in Mon Sep 30 22:47:52 2002 @@ -1,4 +1,4 @@ -dnl ## $Id: configure.in,v 1.375 2002/10/01 01:47:08 sniper Exp $ -*- sh -*- +dnl ## $Id: configure.in,v 1.376 2002/10/01 02:47:52 sniper Exp $ -*- sh -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -278,6 +278,7 @@ PHP_CHECK_FUNC(gethostbyaddr, nsl) PHP_CHECK_FUNC(yp_get_default_domain, nsl) +AC_CHECK_LIB(dl, dlopen, [PHP_ADD_LIBRARY(dl)]) AC_CHECK_LIB(m, sin) dnl Check for resolver routines. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main output.c
yohgaki Mon Sep 30 22:43:33 2002 EDT Modified files: /php4/main output.c Log: Fixed implicit flush. Index: php4/main/output.c diff -u php4/main/output.c:1.123 php4/main/output.c:1.124 --- php4/main/output.c:1.123Mon Sep 30 19:46:43 2002 +++ php4/main/output.c Mon Sep 30 22:43:33 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: output.c,v 1.123 2002/09/30 23:46:43 yohgaki Exp $ */ +/* $Id: output.c,v 1.124 2002/10/01 02:43:33 yohgaki Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -593,6 +593,14 @@ memcpy(target, text, text_length); target[text_length]=0; + /* If implicit_flush is On, send contents to next buffer and return. + Both PG() and OG() should be used since we should flush implicitly + always when implicit_flush is enabled in php.ini */ + if (PG(implicit_flush) || OG(implicit_flush)) { + php_end_ob_buffer(1, 1 TSRMLS_CC); + return; + } + if (OG(active_ob_buffer).chunk_size && OG(active_ob_buffer).text_length >= OG(active_ob_buffer).chunk_size) { zval *output_handler = OG(active_ob_buffer).output_handler; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / configure.in /ext/standard config.m4
sniper Mon Sep 30 21:47:09 2002 EDT Modified files: /php4 configure.in /php4/ext/standard config.m4 Log: - Removed unnecessary dlopen checks. (this is done in Zend.m4 already) Index: php4/configure.in diff -u php4/configure.in:1.374 php4/configure.in:1.375 --- php4/configure.in:1.374 Sun Sep 29 12:22:47 2002 +++ php4/configure.in Mon Sep 30 21:47:08 2002 @@ -1,4 +1,4 @@ -dnl ## $Id: configure.in,v 1.374 2002/09/29 16:22:47 sas Exp $ -*- sh -*- +dnl ## $Id: configure.in,v 1.375 2002/10/01 01:47:08 sniper Exp $ -*- sh -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -278,7 +278,6 @@ PHP_CHECK_FUNC(gethostbyaddr, nsl) PHP_CHECK_FUNC(yp_get_default_domain, nsl) -AC_CHECK_LIB(dl, dlopen, [PHP_ADD_LIBRARY(dl)]) AC_CHECK_LIB(m, sin) dnl Check for resolver routines. Index: php4/ext/standard/config.m4 diff -u php4/ext/standard/config.m4:1.41 php4/ext/standard/config.m4:1.42 --- php4/ext/standard/config.m4:1.41Mon Sep 30 19:31:13 2002 +++ php4/ext/standard/config.m4 Mon Sep 30 21:47:09 2002 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.41 2002/09/30 23:31:13 dreid Exp $ -*- sh -*- +dnl $Id: config.m4,v 1.42 2002/10/01 01:47:09 sniper Exp $ -*- sh -*- divert(3)dnl @@ -184,8 +184,6 @@ fi AC_DEFINE_UNQUOTED(PHP_BLOWFISH_CRYPT, $ac_result, [Whether the system supports BlowFish salt]) ]) - -AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL,1,[ ])]) dnl AC_CHECK_LIB(pam, pam_start, [ dnl EXTRA_LIBS="$EXTRA_LIBS -lpam" -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
sniper Mon Sep 30 21:40:07 2002 EDT Modified files: /php4 NEWS Log: some typos fixed.. Index: php4/NEWS diff -u php4/NEWS:1.1161 php4/NEWS:1.1162 --- php4/NEWS:1.1161Mon Sep 30 20:35:04 2002 +++ php4/NEWS Mon Sep 30 21:40:07 2002 @@ -1,18 +1,18 @@ PHP 4 NEWS ||| ? ? ??? 2002, Version 4.3.0 -- Added getopt() for parsing command line options and arguments. (Jon) - ATTENTION!! "make install" will *always* install the CLI SAPI binary in {PREFIX}/bin/php. If you enable the CGI binary to be built, it will be installed as {PREFIX}/bin/php-cgi. +- Added getopt() for parsing command line options and arguments. (Jon) - Added pg_fetch_assoc(), pg_fetch_all(), pg_metadata(), pg_convert(), pg_insert(), pg_select(), pg_update() and pg_delete(). (Yasuo) - Fixed bug #17281 (Sanity checks for encoding sessions). (Ilia) - Fixed bug #16995 and #19392 (Prevent crash if $HTTP_SESSION_VARS != ARRAY). (Ilia) - Fixed bug #19292 (open_basedir restriction problem). (Rasmus) -- Fixed bug #19366 (gdImageFill crahes when x & y are outside of the - image's boundries). (Ilia) +- Fixed bug #19366 (gdImageFill crashes when x & y are outside of + the image's boundries). (Ilia) - Fixed bug #13936 (__FILE__ constant didn't contain full path). (Ilia) - Renamed: socket_set_timeout() -> stream_set_timeout() -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main output.c
yohgaki Mon Sep 30 19:46:43 2002 EDT Modified files: /php4/main output.c Log: Users can shoot themselves by their own output handler always. Therefore, this check is overkill and it should be documented limitation, IMO. Anyway, a little optimization. Index: php4/main/output.c diff -u php4/main/output.c:1.122 php4/main/output.c:1.123 --- php4/main/output.c:1.122Mon Sep 30 06:18:06 2002 +++ php4/main/output.c Mon Sep 30 19:46:43 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: output.c,v 1.122 2002/09/30 10:18:06 wez Exp $ */ +/* $Id: output.c,v 1.123 2002/09/30 23:46:43 yohgaki Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -388,23 +388,26 @@ { int handler_gz, handler_mb, handler_ic; - /* check for specific handlers where rules apply */ - handler_gz = strcmp(handler_name, "ob_gzhandler"); - handler_mb = strcmp(handler_name, "mb_output_handler"); - handler_ic = strcmp(handler_name, "ob_iconv_handler"); - /* apply rules */ - if (!handler_gz || !handler_mb || !handler_ic) { - if (php_ob_handler_used(handler_name TSRMLS_CC)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler '%s' cannot be used twice", handler_name); - return FAILURE; + if (OG(ob_nesting_level>1)) { + /* check for specific handlers where rules apply */ + handler_gz = strcmp(handler_name, "ob_gzhandler"); + handler_mb = strcmp(handler_name, "mb_output_handler"); + handler_ic = strcmp(handler_name, "ob_iconv_handler"); + /* apply rules */ + if (!handler_gz || !handler_mb || !handler_ic) { + if (php_ob_handler_used(handler_name TSRMLS_CC)) { + php_error_docref("ref.outcontrol" TSRMLS_CC, +E_WARNING, "output handler '%s' cannot be used twice", handler_name); + return FAILURE; + } + if (!handler_gz && php_ob_init_conflict(handler_name, "zlib +output compression" TSRMLS_CC)) + return FAILURE; + if (!handler_mb && php_ob_init_conflict(handler_name, +"ob_iconv_handler" TSRMLS_CC)) + return FAILURE; + if (!handler_ic && php_ob_init_conflict(handler_name, +"mb_output_handler" TSRMLS_CC)) + return FAILURE; } - if (!handler_gz && php_ob_init_conflict(handler_name, "zlib output compression" TSRMLS_CC)) - return FAILURE; - if (!handler_mb && php_ob_init_conflict(handler_name, "ob_iconv_handler" TSRMLS_CC)) - return FAILURE; - if (!handler_ic && php_ob_init_conflict(handler_name, "mb_output_handler" TSRMLS_CC)) - return FAILURE; } + if (OG(ob_nesting_level)>0) { if (OG(ob_nesting_level)==1) { /* initialize stack */ zend_stack_init(&OG(ob_buffers)); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard config.m4
dreid Mon Sep 30 19:31:14 2002 EDT Modified files: /php4/ext/standard config.m4 Log: Use the built in autoconf test for fnmatch. Simply using the AC_CHECK_FUNCS seems to give false positives on beos and reading the comments on other systems as well. Index: php4/ext/standard/config.m4 diff -u php4/ext/standard/config.m4:1.40 php4/ext/standard/config.m4:1.41 --- php4/ext/standard/config.m4:1.40Thu Sep 19 17:57:24 2002 +++ php4/ext/standard/config.m4 Mon Sep 30 19:31:13 2002 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.40 2002/09/19 21:57:24 cmv Exp $ -*- sh -*- +dnl $Id: config.m4,v 1.41 2002/09/30 23:31:13 dreid Exp $ -*- sh -*- divert(3)dnl @@ -224,8 +224,9 @@ ],[ REGEX_TYPE=php ]) - -AC_CHECK_FUNCS(fnmatch glob) + +AC_FUNC_FNMATCH +AC_CHECK_FUNCS(glob) AC_CHECK_FUNCS(strfmon) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/zlib zlib.c /main output.c
s/recursion/loop/ On 09/30/02, "Wez Furlong" <[EMAIL PROTECTED]> wrote: > wez Mon Sep 30 06:18:06 2002 EDT > > Modified files: > /php4/ext/zlibzlib.c > /php4/mainoutput.c > Log: > Fix infinite recursion bug when using zlib output compression. > Cause: the chunk size is taken from the zlib.output_compression setting, > which is 0 or 1. This causes the block_size for output buffer to be set > to 0 (1 / 2) and thus causes infinite recursion in php_ob_allocate(). > Solution: use a value of 0 for the chunk size which will use the default > sizes. Also add a sanity check which will default the block_size to 1 > if it ends up as 0. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/session mod_files.c
wez Mon Sep 30 06:18:58 2002 EDT Modified files: /php4/ext/session mod_files.c Log: Add header file required for pread/pwrite (on my system at least). Index: php4/ext/session/mod_files.c diff -u php4/ext/session/mod_files.c:1.80 php4/ext/session/mod_files.c:1.81 --- php4/ext/session/mod_files.c:1.80 Wed Sep 25 08:38:45 2002 +++ php4/ext/session/mod_files.cMon Sep 30 06:18:57 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: mod_files.c,v 1.80 2002/09/25 12:38:45 sas Exp $ */ +/* $Id: mod_files.c,v 1.81 2002/09/30 10:18:57 wez Exp $ */ #include "php.h" @@ -38,6 +38,10 @@ #include #include + +#if HAVE_UNISTD_H +#include +#endif #include "php_session.h" #include "mod_files.h" -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/zlib zlib.c /main output.c
wez Mon Sep 30 06:18:06 2002 EDT Modified files: /php4/ext/zlib zlib.c /php4/main output.c Log: Fix infinite recursion bug when using zlib output compression. Cause: the chunk size is taken from the zlib.output_compression setting, which is 0 or 1. This causes the block_size for output buffer to be set to 0 (1 / 2) and thus causes infinite recursion in php_ob_allocate(). Solution: use a value of 0 for the chunk size which will use the default sizes. Also add a sanity check which will default the block_size to 1 if it ends up as 0. Index: php4/ext/zlib/zlib.c diff -u php4/ext/zlib/zlib.c:1.149 php4/ext/zlib/zlib.c:1.150 --- php4/ext/zlib/zlib.c:1.149 Tue Sep 3 18:54:02 2002 +++ php4/ext/zlib/zlib.cMon Sep 30 06:18:06 2002 @@ -18,7 +18,7 @@ | Jade Nicoletti <[EMAIL PROTECTED]> | +--+ */ -/* $Id: zlib.c,v 1.149 2002/09/03 22:54:02 sniper Exp $ */ +/* $Id: zlib.c,v 1.150 2002/09/30 10:18:06 wez Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -230,6 +230,8 @@ ZLIBG(ob_gzhandler_status) = 0; ZLIBG(ob_gzip_coding) = 0; if (chunk_size) { + if (chunk_size == 1) + chunk_size = 0; /* use the default size */ php_enable_output_compression(chunk_size TSRMLS_CC); } return SUCCESS; Index: php4/main/output.c diff -u php4/main/output.c:1.121 php4/main/output.c:1.122 --- php4/main/output.c:1.121Mon Sep 23 10:18:42 2002 +++ php4/main/output.c Mon Sep 30 06:18:06 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: output.c,v 1.121 2002/09/23 14:18:42 zeev Exp $ */ +/* $Id: output.c,v 1.122 2002/09/30 10:18:06 wez Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -132,6 +132,8 @@ if (chunk_size) { initial_size = (chunk_size*3/2); block_size = chunk_size/2; + if (block_size == 0) + block_size = 1; } else { initial_size = 40*1024; block_size = 10*1024; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/cgi .cvsignore
edink Mon Sep 30 05:48:55 2002 EDT Modified files: /php4/sapi/cgi .cvsignore Log: Those can be safely ignored. Index: php4/sapi/cgi/.cvsignore diff -u php4/sapi/cgi/.cvsignore:1.7 php4/sapi/cgi/.cvsignore:1.8 --- php4/sapi/cgi/.cvsignore:1.7Sat Apr 20 05:30:40 2002 +++ php4/sapi/cgi/.cvsignoreMon Sep 30 05:48:54 2002 @@ -5,3 +5,5 @@ Release_TS Debug_TS *.plg +.libs +php-cgi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/overload php_overload.h
derick Mon Sep 30 05:40:13 2002 EDT Modified files: /php4/ext/overload php_overload.h Log: - Fix ZE2 build when overload is enabled Index: php4/ext/overload/php_overload.h diff -u php4/ext/overload/php_overload.h:1.6 php4/ext/overload/php_overload.h:1.7 --- php4/ext/overload/php_overload.h:1.6Thu Feb 28 03:26:33 2002 +++ php4/ext/overload/php_overload.hMon Sep 30 05:40:12 2002 @@ -19,6 +19,7 @@ #ifndef PHP_OVERLOAD_H #define PHP_OVERLOAD_H +#ifndef ZEND_ENGINE_2 #if HAVE_OVERLOAD extern zend_module_entry overload_module_entry; @@ -52,6 +53,7 @@ #endif #endif /* HAVE_OVERLOAD */ +#endif /* ZEND_ENGINE_2 */ #endif /* PHP_OVERLOAD_H */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
yohgaki Mon Sep 30 05:35:04 2002 EDT Modified files: /php4 NEWS Log: Fixed typo. # Thanks to Andrey Hristov. Index: php4/NEWS diff -u php4/NEWS:1.1159 php4/NEWS:1.1160 --- php4/NEWS:1.1159Mon Sep 30 05:07:10 2002 +++ php4/NEWS Mon Sep 30 05:35:04 2002 @@ -4,7 +4,7 @@ - ATTENTION!! "make install" will *always* install the CLI SAPI binary in {PREFIX}/bin/php. If you enable the CGI binary to be built, it will be installed as {PREFIX}/bin/php-cgi. -- Added pg_fetch_assoc(), pg_fetch_all(), pg_metadate(), pg_convert(), +- Added pg_fetch_assoc(), pg_fetch_all(), pg_metadata(), pg_convert(), pg_insert(), pg_select(), pg_update() and pg_delete(). (Yasuo) - Fixed bug #17281 (Sanity checks for encoding sessions). (Ilia) - Fixed bug #16995 and #19392 (Prevent crash if $HTTP_SESSION_VARS != ARRAY). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/hyperwave hw.c
steinm Mon Sep 30 05:27:55 2002 EDT Modified files: /php4/ext/hyperwave hw.c Log: - make_objrec_from_array() gets a second parameter to handle key/pairs of the form key=value and key:value. - Proper treatment of the attribute SQLStmt Index: php4/ext/hyperwave/hw.c diff -u php4/ext/hyperwave/hw.c:1.109 php4/ext/hyperwave/hw.c:1.110 --- php4/ext/hyperwave/hw.c:1.109 Wed Jul 24 01:59:00 2002 +++ php4/ext/hyperwave/hw.c Mon Sep 30 05:27:54 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: hw.c,v 1.109 2002/07/24 05:59:00 steinm Exp $ */ +/* $Id: hw.c,v 1.110 2002/09/30 09:27:54 steinm Exp $ */ #include #include @@ -313,6 +313,7 @@ add_assoc_long(spec_arr, "Group", HW_ATTR_NONE); add_assoc_long(spec_arr, "HtmlAttr", HW_ATTR_NONE); add_assoc_long(spec_arr, "Parent", HW_ATTR_NONE); + add_assoc_long(spec_arr, "SQLStmt", HW_ATTR_NR); } if (array_init(*return_value) == FAILURE) { @@ -549,9 +550,10 @@ #define BUFFERLEN 1024 /* {{{ make_objrec_from_array */ -static char * make_objrec_from_array(HashTable *lht) { +static char * make_objrec_from_array(HashTable *lht, char delim) { int i, count, keytype; - ulong length; + ulong idx; + uint length; char *key, str[BUFFERLEN], *objrec = NULL; zval *keydata, **keydataptr; @@ -560,25 +562,32 @@ if(0 == (count = zend_hash_num_elements(lht))) return NULL; - + + if(delim == 0) + delim = '='; + zend_hash_internal_pointer_reset(lht); objrec = malloc(1); *objrec = '\0'; for(i=0; i 0) { - strarr = make_objrec_from_array(Z_ARRVAL_P(keydata)); + strarr = +make_objrec_from_array(Z_ARRVAL_P(keydata), ':'); len = strlen(strarr) - 1; keylen = strlen(key); if(NULL == (ptr = malloc(len + 1 + count*(keylen+1 { @@ -605,8 +614,8 @@ strcpy(ptr1, key); ptr1 += keylen; *ptr1++ = '='; - } else if(strarr[i] == '=') - ptr1[-1] = ':'; + }/* else if(strarr[i] == '=') + ptr1[-1] = ':'; */ } *ptr1++ = '\n'; *ptr1 = '\0'; @@ -1904,7 +1913,7 @@ char *strarr, *ptr, *ptr1; count = zend_hash_num_elements(Z_ARRVAL_P(data)); if(count > 0) { - strarr = make_objrec_from_array(Z_ARRVAL_P(data)); + strarr = +make_objrec_from_array(Z_ARRVAL_P(data), ':'); len = strlen(strarr) - 1; keylen = strlen(key); if(NULL == (ptr = malloc(len + 1 + count*(keylen+1+4 { @@ -1928,8 +1937,8 @@ strcpy(ptr1, key); ptr1 += keylen; *ptr1++ = '='; - } else if(strarr[i] == '=') - ptr1[-1] = ':'; + } /* else if(strarr[i] == '=') + ptr1[-1] = ':'; */ } *ptr1 = '\0'; strlcpy(addattribute, ptr, sizeof(addattribute)); @@ -1974,7 +1983,7 @@ char *strarr, *ptr, *ptr1; count = zend_hash_num_elements(Z_ARRVAL_P(data)); if(count > 0) { - strarr = make_objrec_from_array(Z_ARRVAL_P(data)); + strarr = +make_objrec_from_array(Z_ARRVAL_P(data), ':');
[PHP-CVS] cvs: php4 / Makefile.global
yohgaki Mon Sep 30 05:15:24 2002 EDT Modified files: /php4 Makefile.global Log: Remove space Index: php4/Makefile.global diff -u php4/Makefile.global:1.28 php4/Makefile.global:1.29 --- php4/Makefile.global:1.28 Mon Sep 30 00:42:11 2002 +++ php4/Makefile.globalMon Sep 30 05:15:23 2002 @@ -52,7 +52,7 @@ clean: find . -name \*.lo -o -name \*.o | xargs rm -f - find . -name \*.la -o -name \*.a | xargs rm -f + find . -name \*.la -o -name \*.a | xargs rm -f find . -name \*.so | xargs rm -f find . -name .libs -a -type d|xargs rm -rf rm -f libphp4.la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/* -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/pgsql pgsql.c php_pgsql.h
yohgaki Mon Sep 30 05:07:58 2002 EDT Modified files: /php4/ext/pgsql pgsql.c php_pgsql.h Log: Added pg_fetch_assoc(). Fixed proto. Added/fixed comments. # It seems last attempt was failed. Try committing again. Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.223 php4/ext/pgsql/pgsql.c:1.224 --- php4/ext/pgsql/pgsql.c:1.223Mon Sep 30 03:35:41 2002 +++ php4/ext/pgsql/pgsql.c Mon Sep 30 05:07:57 2002 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.223 2002/09/30 07:35:41 yohgaki Exp $ */ +/* $Id: pgsql.c,v 1.224 2002/09/30 09:07:57 yohgaki Exp $ */ #include @@ -95,6 +95,7 @@ /* result functions */ PHP_FE(pg_fetch_result, NULL) PHP_FE(pg_fetch_row,NULL) + PHP_FE(pg_fetch_assoc, NULL) PHP_FE(pg_fetch_array, NULL) PHP_FE(pg_fetch_object, NULL) PHP_FE(pg_fetch_all,NULL) @@ -1326,6 +1327,18 @@ } /* }}} */ +/* {{{ proto array pg_fetch_assoc(resource result [, int row]) + Fetch a row as an assoc array */ +PHP_FUNCTION(pg_fetch_assoc) +{ + /* pg_fetch_assoc() is added from PHP 4.3.0. It should raise error, when + there is 3rd parameter */ + if (ZEND_NUM_ARGS() > 2) + WRONG_PARAM_COUNT; + php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, PGSQL_ASSOC); +} +/* }}} */ + /* {{{ proto array pg_fetch_array(resource result [, int row [, int result_type]]) Fetch a row as an array */ PHP_FUNCTION(pg_fetch_array) @@ -1334,10 +1347,12 @@ } /* }}} */ -/* {{{ 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) { + /* pg_fetch_object() allowed result_type used to be. 3rd parameter + must be allowed for compatibility */ php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, PGSQL_ASSOC); if (Z_TYPE_P(return_value)==IS_ARRAY) { object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value)); @@ -3794,7 +3809,7 @@ } /* }}} */ -/* {{{ proto bool pg_insert(resource db, string table, array values[, int options]) +/* {{{ proto mixed pg_insert(resource db, string table, array values[, int options]) Insert values (filed=>value) to table */ PHP_FUNCTION(pg_insert) { @@ -3943,7 +3958,7 @@ } /* }}} */ -/* {{{ proto bool pg_update(resource db, string table, array fields, array ids[, int options]) +/* {{{ proto mixed pg_update(resource db, string table, array fields, array ids[, int +options]) Update table using values (field=>value) and ids (id=>value) */ PHP_FUNCTION(pg_update) { @@ -4032,7 +4047,7 @@ } /* }}} */ -/* {{{ proto bool pg_delete(resource db, string table, array ids[, int options]) +/* {{{ proto mixed pg_delete(resource db, string table, array ids[, int options]) Delete records has ids (id=>value) */ PHP_FUNCTION(pg_delete) { @@ -4169,7 +4184,7 @@ } /* }}} */ -/* {{{ proto array pg_select(resource db, string table, array ids[, int options]) +/* {{{ proto mixed pg_select(resource db, string table, array ids[, int options]) Select records that has ids (id=>value) */ PHP_FUNCTION(pg_select) { Index: php4/ext/pgsql/php_pgsql.h diff -u php4/ext/pgsql/php_pgsql.h:1.47 php4/ext/pgsql/php_pgsql.h:1.48 --- php4/ext/pgsql/php_pgsql.h:1.47 Sun Jul 21 03:25:10 2002 +++ php4/ext/pgsql/php_pgsql.h Mon Sep 30 05:07:57 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_pgsql.h,v 1.47 2002/07/21 07:25:10 yohgaki Exp $ */ +/* $Id: php_pgsql.h,v 1.48 2002/09/30 09:07:57 yohgaki Exp $ */ #ifndef PHP_PGSQL_H #define PHP_PGSQL_H @@ -76,6 +76,7 @@ PHP_FUNCTION(pg_send_query); PHP_FUNCTION(pg_cancel_query); /* result functions */ +PHP_FUNCTION(pg_fetch_assoc); PHP_FUNCTION(pg_fetch_array); PHP_FUNCTION(pg_fetch_object); PHP_FUNCTION(pg_fetch_result); @@ -142,7 +143,7 @@ #define PGSQL_CONV_IGNORE_NOT_NULL (1<<3) /* Ignore NOT NULL constraints */ #define PGSQL_CONV_OPTS (PGSQL_CONV_IGNORE_DEFAULT|PGSQL_CONV_FORCE_NULL|PGSQL_CONV_IGNORE_NOT_NULL) /* php_pgsql_insert/update/select/delete options */ -#define PGSQL_DML_NO_CONV (1<<8) /* Call php_pgsql_convert() */ +#define PGSQL_DML_NO_CONV (1<<8) /* Do not call php_pgsql_convert() */ #define PGSQL_DML_EXEC (1<<9) /* Execute query */ #define PGSQL_DML_ASYNC (1<<10)/* Do async query */ #define PGSQL_DML_STRING(1<<11)/* Return query string */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
wez Mon Sep 30 05:07:11 2002 EDT Modified files: /php4 NEWS Log: Even better. Index: php4/NEWS diff -u php4/NEWS:1.1158 php4/NEWS:1.1159 --- php4/NEWS:1.1158Mon Sep 30 05:04:48 2002 +++ php4/NEWS Mon Sep 30 05:07:10 2002 @@ -2,7 +2,7 @@ ||| ? ? ??? 2002, Version 4.3.0 - ATTENTION!! "make install" will *always* install the CLI SAPI binary in - {PREFIX}/bin/php. If you enabled the CGI binary to be built, it is + {PREFIX}/bin/php. If you enable the CGI binary to be built, it will be installed as {PREFIX}/bin/php-cgi. - Added pg_fetch_assoc(), pg_fetch_all(), pg_metadate(), pg_convert(), pg_insert(), pg_select(), pg_update() and pg_delete(). (Yasuo) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
wez Mon Sep 30 05:04:49 2002 EDT Modified files: /php4 NEWS Log: Slight grammar fix. Index: php4/NEWS diff -u php4/NEWS:1.1157 php4/NEWS:1.1158 --- php4/NEWS:1.1157Mon Sep 30 04:32:03 2002 +++ php4/NEWS Mon Sep 30 05:04:48 2002 @@ -2,7 +2,7 @@ ||| ? ? ??? 2002, Version 4.3.0 - ATTENTION!! "make install" will *always* install the CLI SAPI binary in - {PREFIX}/bin/php. If you did enable the CGI binary to be build, it is + {PREFIX}/bin/php. If you enabled the CGI binary to be built, it is installed as {PREFIX}/bin/php-cgi. - Added pg_fetch_assoc(), pg_fetch_all(), pg_metadate(), pg_convert(), pg_insert(), pg_select(), pg_update() and pg_delete(). (Yasuo) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
yohgaki Mon Sep 30 04:32:04 2002 EDT Modified files: /php4 NEWS Log: Consolidate some entries. Index: php4/NEWS diff -u php4/NEWS:1.1156 php4/NEWS:1.1157 --- php4/NEWS:1.1156Mon Sep 30 04:26:54 2002 +++ php4/NEWS Mon Sep 30 04:32:03 2002 @@ -4,8 +4,8 @@ - ATTENTION!! "make install" will *always* install the CLI SAPI binary in {PREFIX}/bin/php. If you did enable the CGI binary to be build, it is installed as {PREFIX}/bin/php-cgi. -- Added pg_fetch_assoc() returns associative array from result resource. - (Yasuo) +- Added pg_fetch_assoc(), pg_fetch_all(), pg_metadate(), pg_convert(), + pg_insert(), pg_select(), pg_update() and pg_delete(). (Yasuo) - Fixed bug #17281 (Sanity checks for encoding sessions). (Ilia) - Fixed bug #16995 and #19392 (Prevent crash if $HTTP_SESSION_VARS != ARRAY). (Ilia) @@ -166,7 +166,6 @@ representation instead of echoing it. (Derick) - Added mysql_ping(), mysql_real_escape_string(), mysql_character_set_name(), mysql_thread_id(), mysql_stat() and mysql_list_processes(). (Zak, Georg) -- Added pg_fetch_all() which fetches all rows in a result. (Yasuo) - Added safe_mode & open_basedir checks for pg_lo_export(). (Yasuo) - Added open_basedir check for pg_lo_import(). (Yasuo) - Fixed infinite recursion crash bug in ticks. (Jason) @@ -273,8 +272,6 @@ - Added version information to the .dll and .exe files created under Windows. (jtate) - Added __FUNCTION__ and __CLASS__ constants. (Jani, Zend Engine) -- Added pg_metadate(), pg_convert(), pg_insert(), pg_select(), pg_update() - and pg_delete(). (Yasuo) - Added optional 2nd parameter for pg_result_status() to specify return type. (Yasuo) - Added "log_errors_max_len" php.ini option which controls maximum length for -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
yohgaki Mon Sep 30 04:26:54 2002 EDT Modified files: /php4 NEWS Log: Fixed my name :) Index: php4/NEWS diff -u php4/NEWS:1.1155 php4/NEWS:1.1156 --- php4/NEWS:1.1155Mon Sep 30 04:26:23 2002 +++ php4/NEWS Mon Sep 30 04:26:54 2002 @@ -5,7 +5,7 @@ {PREFIX}/bin/php. If you did enable the CGI binary to be build, it is installed as {PREFIX}/bin/php-cgi. - Added pg_fetch_assoc() returns associative array from result resource. - (Yasu) + (Yasuo) - Fixed bug #17281 (Sanity checks for encoding sessions). (Ilia) - Fixed bug #16995 and #19392 (Prevent crash if $HTTP_SESSION_VARS != ARRAY). (Ilia) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
yohgaki Mon Sep 30 04:26:23 2002 EDT Modified files: /php4 NEWS Log: Added pg_fetch_assoc() Index: php4/NEWS diff -u php4/NEWS:1.1154 php4/NEWS:1.1155 --- php4/NEWS:1.1154Mon Sep 30 01:20:17 2002 +++ php4/NEWS Mon Sep 30 04:26:23 2002 @@ -4,6 +4,8 @@ - ATTENTION!! "make install" will *always* install the CLI SAPI binary in {PREFIX}/bin/php. If you did enable the CGI binary to be build, it is installed as {PREFIX}/bin/php-cgi. +- Added pg_fetch_assoc() returns associative array from result resource. + (Yasu) - Fixed bug #17281 (Sanity checks for encoding sessions). (Ilia) - Fixed bug #16995 and #19392 (Prevent crash if $HTTP_SESSION_VARS != ARRAY). (Ilia) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/pgsql pgsql.c
yohgaki Mon Sep 30 03:35:41 2002 EDT Modified files: /php4/ext/pgsql pgsql.c Log: Use PGSQL_CONV_FORCE_NULL as it is supposed. PGSQL_CONV_FORCE_NULL inserts NULL to field instead of NULL string for string type tuples. Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.222 php4/ext/pgsql/pgsql.c:1.223 --- php4/ext/pgsql/pgsql.c:1.222Mon Sep 30 03:24:41 2002 +++ php4/ext/pgsql/pgsql.c Mon Sep 30 03:35:41 2002 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.222 2002/09/30 07:24:41 yohgaki Exp $ */ +/* $Id: pgsql.c,v 1.223 2002/09/30 07:35:41 yohgaki Exp $ */ #include @@ -3269,7 +3269,12 @@ switch (Z_TYPE_PP(val)) { case IS_STRING: if (Z_STRLEN_PP(val) == 0) { - ZVAL_STRING(new_val, empty_string, 1); + if (opt & +PGSQL_CONV_FORCE_NULL) { + ZVAL_STRING(new_val, +"NULL", 1); + } + else { + ZVAL_STRING(new_val, +empty_string, 1); + } } else { Z_TYPE_P(new_val) = IS_STRING; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php