[PHP-CVS] cvs: php4 / NEWS
sas Wed Oct 2 04:14:47 2002 EDT Modified files: /php4 NEWS Log: Reflect actual stance wrt cli/cgi Index: php4/NEWS diff -u php4/NEWS:1.1168 php4/NEWS:1.1169 --- php4/NEWS:1.1168Wed Oct 2 00:03:20 2002 +++ php4/NEWS Wed Oct 2 04:14:47 2002 @@ -1,8 +1,8 @@ PHP 4 NEWS ||| ? ? ??? 2002, Version 4.3.0 -- 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 +- ATTENTION! "make install" will *by default* install the CLI SAPI binary in + {PREFIX}/bin/php. If you don't disable the CGI binary, it will be installed as {PREFIX}/bin/php-cgi. - Fixed bug #17825 (ob_start() chunk size option didn't work well). (Yasuo) - Fixed output buffering implicit flush. (Yasuo) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / acinclude.m4
sas Wed Oct 2 04:32:26 2002 EDT Modified files: /php4 acinclude.m4 Log: Another Linux x86 system returns ELIMIT so we need to check errno as well before assuming that pread/pwrite work. Index: php4/acinclude.m4 diff -u php4/acinclude.m4:1.208 php4/acinclude.m4:1.209 --- php4/acinclude.m4:1.208 Wed Oct 2 02:05:15 2002 +++ php4/acinclude.m4 Wed Oct 2 04:32:26 2002 @@ -1,4 +1,4 @@ -dnl $Id: acinclude.m4,v 1.208 2002/10/02 06:05:15 sas Exp $ +dnl $Id: acinclude.m4,v 1.209 2002/10/02 08:32:26 sas Exp $ dnl dnl This file contains local autoconf functions. @@ -380,6 +380,7 @@ #include #include #include +#include $1 main() { int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600); @@ -387,7 +388,7 @@ if (fd < 0) exit(1); if (pwrite(fd, "text", 4, 0) != 4) exit(1); /* Linux glibc breakage until 2.2.5 */ -if (pwrite(fd, "text", 4, -1) != -1) exit(1); +if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1); exit(0); } @@ -407,6 +408,7 @@ #include #include #include +#include $1 main() { char buf[3]; @@ -414,7 +416,7 @@ if (fd < 0) exit(1); if (pread(fd, buf, 2, 0) != 2) exit(1); /* Linux glibc breakage until 2.2.5 */ -if (pread(fd, buf, 2, -1) != -1) exit(1); +if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1); exit(0); } ],[ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / acinclude.m4 configure.in
helly Wed Oct 2 08:52:54 2002 EDT Modified files: /php4 acinclude.m4 configure.in Log: Check for C99 conformance of snprintf. #This way we force using internal version if a broken library is used. #E.g. length parameter is broken, return value or default precision wrong. Index: php4/acinclude.m4 diff -u php4/acinclude.m4:1.209 php4/acinclude.m4:1.210 --- php4/acinclude.m4:1.209 Wed Oct 2 04:32:26 2002 +++ php4/acinclude.m4 Wed Oct 2 08:52:53 2002 @@ -1,4 +1,4 @@ -dnl $Id: acinclude.m4,v 1.209 2002/10/02 08:32:26 sas Exp $ +dnl $Id: acinclude.m4,v 1.210 2002/10/02 12:52:53 helly Exp $ dnl dnl This file contains local autoconf functions. @@ -1164,7 +1164,7 @@ ]) dnl -dnl Check for broken sprintf() +dnl Check for broken sprintf(), C99 conformance dnl AC_DEFUN(PHP_AC_BROKEN_SPRINTF,[ AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ @@ -1177,9 +1177,42 @@ ]) ]) if test "$ac_cv_broken_sprintf" = "yes"; then -AC_DEFINE(PHP_BROKEN_SPRINTF, 1, [ ]) +AC_DEFINE(PHP_BROKEN_SPRINTF, 1, [Whether sprintf is C99 conform]) else -AC_DEFINE(PHP_BROKEN_SPRINTF, 0, [ ]) +AC_DEFINE(PHP_BROKEN_SPRINTF, 0, [Whether sprintf is C99 conform]) + fi +]) + +dnl +dnl Check for broken snprintf(), C99 conformance +dnl +AC_DEFUN(PHP_AC_BROKEN_SNPRINTF,[ + AC_CACHE_CHECK(whether snprintf is broken, ac_cv_broken_snprintf,[ +AC_TRY_RUN([ +#define NULL (0L) +main() { + char buf[20]; + int res = 0; + res = res || (snprintf(buf, 2, "marcus") != 6); + res = res || (buf[1] != '\0'); + res = res || (snprintf(buf, 0, "boerger") != 7); + res = res || (buf[0] != 'm'); + res = res || (snprintf(NULL, 0, "boerger") != 7); + res = res || (snprintf(buf, sizeof(buf), "%f", 0.12345678) != 8); + exit(res); +} +],[ + ac_cv_broken_snprintf=no +],[ + ac_cv_broken_snprintf=yes +],[ + ac_cv_broken_snprintf=no +]) + ]) + if test "$ac_cv_broken_snprintf" = "yes"; then +AC_DEFINE(PHP_BROKEN_SNPRINTF, 1, [Whether snprintf is C99 conform]) + else +AC_DEFINE(PHP_BROKEN_SNPRINTF, 0, [Whether snprintf is C99 conform]) fi ]) Index: php4/configure.in diff -u php4/configure.in:1.376 php4/configure.in:1.377 --- php4/configure.in:1.376 Mon Sep 30 22:47:52 2002 +++ php4/configure.in Wed Oct 2 08:52:53 2002 @@ -1,4 +1,4 @@ -dnl ## $Id: configure.in,v 1.376 2002/10/01 02:47:52 sniper Exp $ -*- sh -*- +dnl ## $Id: configure.in,v 1.377 2002/10/02 12:52:53 helly Exp $ -*- sh -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -493,6 +493,7 @@ AC_FUNC_UTIME_NULL AC_FUNC_ALLOCA PHP_AC_BROKEN_SPRINTF +PHP_AC_BROKEN_SNPRINTF PHP_DECLARED_TIMEZONE PHP_TIME_R_TYPE PHP_READDIR_R_TYPE -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/com COM.c
phanto Wed Oct 2 08:53:51 2002 EDT Modified files: /php4/ext/com COM.c Log: fixes bugs #19156 and #19544 Index: php4/ext/com/COM.c diff -u php4/ext/com/COM.c:1.86 php4/ext/com/COM.c:1.87 --- php4/ext/com/COM.c:1.86 Mon Aug 26 09:36:35 2002 +++ php4/ext/com/COM.c Wed Oct 2 08:53:51 2002 @@ -18,7 +18,7 @@ | Wez Furlong <[EMAIL PROTECTED]> | +--+ */ -/* $Id: COM.c,v 1.86 2002/08/26 13:36:35 wez Exp $ */ +/* $Id: COM.c,v 1.87 2002/10/02 12:53:51 phanto Exp $ */ /* * This module implements support for COM components that support the IDispatch * interface. Both local (COM) and remote (DCOM) components can be accessed. @@ -291,11 +291,9 @@ if (C_HASENUM(obj) = SUCCEEDED(C_DISPATCH_VT(obj)->Invoke(C_DISPATCH(obj), DISPID_NEWENUM, &IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD|DISPATCH_PROPERTYGET, &dispparams, var_result, NULL, NULL))) { if (V_VT(var_result) == VT_UNKNOWN) { - V_UNKNOWN(var_result)->lpVtbl->AddRef(V_UNKNOWN(var_result)); C_HASENUM(obj) = SUCCEEDED(V_UNKNOWN(var_result)->lpVtbl->QueryInterface(V_UNKNOWN(var_result), &IID_IEnumVARIANT, (void**)&C_ENUMVARIANT(obj))); } else if (V_VT(var_result) == VT_DISPATCH) { - V_DISPATCH(var_result)->lpVtbl->AddRef(V_DISPATCH(var_result)); C_HASENUM(obj) = SUCCEEDED(V_DISPATCH(var_result)->lpVtbl->QueryInterface(V_DISPATCH(var_result), &IID_IEnumVARIANT, (void**)&C_ENUMVARIANT(obj))); } @@ -1872,6 +1870,7 @@ switch (Z_TYPE_P(overloaded_property)) { case OE_IS_ARRAY: if (do_COM_offget(var_result, obj, &overloaded_property->element, FALSE TSRMLS_CC) == FAILURE) { + pval_destructor(&overloaded_property->element); FREE_VARIANT(var_result); FREE_COM(obj_prop); @@ -1881,6 +1880,7 @@ case OE_IS_OBJECT: if (do_COM_propget(var_result, obj, &overloaded_property->element, FALSE TSRMLS_CC) == FAILURE) { + pval_destructor(&overloaded_property->element); FREE_VARIANT(var_result); FREE_COM(obj_prop); @@ -1888,21 +1888,24 @@ } break; - case OE_IS_METHOD: { - FREE_VARIANT(var_result); - if (obj != obj_prop) { - FREE_COM(obj_prop); + case OE_IS_METHOD: + pval_destructor(&overloaded_property->element); + FREE_VARIANT(var_result); - return_value = *object; - ZVAL_ADDREF(&return_value); - } else { - RETVAL_COM(obj); - } - return return_value; + if (obj != obj_prop) { + FREE_COM(obj_prop); + + return_value = *object; + ZVAL_ADDREF(&return_value); + } else { + RETVAL_COM(obj); } - break; + + return return_value; } + pval_destructor(&overloaded_property->element); + if (V_VT(var_result) == VT_DISPATCH) { if (V_DISPATCH(var_result) == NULL) { FREE_VARIANT(var_result); @@ -1920,8 +1923,6 @@ FREE_COM(obj_prop); obj_prop = NULL; } - - pval_destructor(&overloaded_property->element); } if (obj_prop != NULL) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main streams.c
helly Wed Oct 2 09:18:01 2002 EDT Modified files: /php4/main streams.c Log: Missing variable init Index: php4/main/streams.c diff -u php4/main/streams.c:1.86 php4/main/streams.c:1.87 --- php4/main/streams.c:1.86Sat Sep 28 18:10:46 2002 +++ php4/main/streams.c Wed Oct 2 09:18:01 2002 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: streams.c,v 1.86 2002/09/28 22:10:46 wez Exp $ */ +/* $Id: streams.c,v 1.87 2002/10/02 13:18:01 helly Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -615,7 +615,7 @@ PHPAPI char *_php_stream_gets(php_stream *stream, char *buf, size_t maxlen TSRMLS_DC) { - char *cr, *lf, *eol; + char *cr, *lf, *eol = NULL; size_t toread = 0, didread = 0, justread = 0, avail = 0; char *readptr; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main streams.c
helly Wed Oct 2 09:25:38 2002 EDT Modified files: /php4/main streams.c Log: Another missing variable init #Wez shouldn't "stream->filterhead->fops->flush()" affect return value also? Index: php4/main/streams.c diff -u php4/main/streams.c:1.87 php4/main/streams.c:1.88 --- php4/main/streams.c:1.87Wed Oct 2 09:18:01 2002 +++ php4/main/streams.c Wed Oct 2 09:25:38 2002 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: streams.c,v 1.87 2002/10/02 13:18:01 helly Exp $ */ +/* $Id: streams.c,v 1.88 2002/10/02 13:25:38 helly Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -687,7 +687,7 @@ PHPAPI int _php_stream_flush(php_stream *stream, int closing TSRMLS_DC) { - int ret; + int ret = 0; if (stream->filterhead) stream->filterhead->fops->flush(stream, stream->filterhead, closing TSRMLS_CC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard info.c
cmv Wed Oct 2 10:27:32 2002 EDT Modified files: /php4/ext/standard info.c Log: Fix for SRM module (and maybe others). Header rows are now not HTML escaped, so make sure you do this yourself in the modules. Index: php4/ext/standard/info.c diff -u php4/ext/standard/info.c:1.209 php4/ext/standard/info.c:1.210 --- php4/ext/standard/info.c:1.209 Fri Sep 27 12:05:47 2002 +++ php4/ext/standard/info.cWed Oct 2 10:27:32 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: info.c,v 1.209 2002/09/27 16:05:47 cmv Exp $ */ +/* $Id: info.c,v 1.210 2002/10/02 14:27:32 cmv Exp $ */ #include "php.h" #include "php_ini.h" @@ -671,7 +671,7 @@ } if (PG(html_errors)) { PUTS(""); - PUTS(php_info_html_esc(row_element TSRMLS_CC)); + PUTS(row_element); PUTS(""); } else { PUTS(row_element); -- 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
helly Wed Oct 2 11:02:18 2002 EDT Modified files: /php4/main output.c /php4/ext/zlib zlib.c Log: Revisted Wez patch: chunk_size 0 means cahce the whole output. So we must apply the default before calling php_enable_output_compression(). I have left the default setting in the rinit function even though i do think it is not necessary. Index: php4/main/output.c diff -u php4/main/output.c:1.125 php4/main/output.c:1.126 --- php4/main/output.c:1.125Tue Oct 1 06:01:56 2002 +++ php4/main/output.c Wed Oct 2 11:02:15 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: output.c,v 1.125 2002/10/01 10:01:56 yohgaki Exp $ */ +/* $Id: output.c,v 1.126 2002/10/02 15:02:15 helly Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -130,10 +130,10 @@ return FAILURE; } if (chunk_size) { + if (chunk_size==1) + chunk_size = 4096; 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; Index: php4/ext/zlib/zlib.c diff -u php4/ext/zlib/zlib.c:1.150 php4/ext/zlib/zlib.c:1.151 --- php4/ext/zlib/zlib.c:1.150 Mon Sep 30 06:18:06 2002 +++ php4/ext/zlib/zlib.cWed Oct 2 11:02:16 2002 @@ -18,7 +18,7 @@ | Jade Nicoletti <[EMAIL PROTECTED]> | +--+ */ -/* $Id: zlib.c,v 1.150 2002/09/30 10:18:06 wez Exp $ */ +/* $Id: zlib.c,v 1.151 2002/10/02 15:02:16 helly Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -230,8 +230,10 @@ ZLIBG(ob_gzhandler_status) = 0; ZLIBG(ob_gzip_coding) = 0; if (chunk_size) { - if (chunk_size == 1) - chunk_size = 0; /* use the default size */ + if (chunk_size == 1) { + chunk_size = 4096; /* use the default size */ + ZLIBG(output_compression) = chunk_size; + } php_enable_output_compression(chunk_size TSRMLS_CC); } return SUCCESS; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main output.c
helly Wed Oct 2 11:10:11 2002 EDT Modified files: /php4/main output.c Log: Modified get_status(): Display chunk_size allways and size which is in most cases initial_size as well as block_size only when used. Index: php4/main/output.c diff -u php4/main/output.c:1.126 php4/main/output.c:1.127 --- php4/main/output.c:1.126Wed Oct 2 11:02:15 2002 +++ php4/main/output.c Wed Oct 2 11:10:11 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: output.c,v 1.126 2002/10/02 15:02:15 helly Exp $ */ +/* $Id: output.c,v 1.127 2002/10/02 15:10:11 helly Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -869,14 +869,17 @@ return FAILURE; } + add_assoc_long(elem, "chunk_size", ob_buffer->chunk_size); + if (!ob_buffer->chunk_size) { + add_assoc_long(elem, "size", ob_buffer->size); + add_assoc_long(elem, "block_size", ob_buffer->block_size); + } if (ob_buffer->internal_output_handler) { add_assoc_long(elem, "type", PHP_OUTPUT_HANDLER_INTERNAL); add_assoc_long(elem, "buffer_size", ob_buffer->internal_output_handler_buffer_size); } else { add_assoc_long(elem, "type", PHP_OUTPUT_HANDLER_USER); - add_assoc_long(elem, "initial_size", ob_buffer->size); - add_assoc_long(elem, "chunk_size", ob_buffer->chunk_size); } add_assoc_long(elem, "status", ob_buffer->status); add_assoc_string(elem, "name", ob_buffer->handler_name, 1); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS /main output.c
helly Wed Oct 2 11:36:29 2002 EDT Modified files: /php4 NEWS /php4/main output.c Log: Fix implicit_flush Index: php4/NEWS diff -u php4/NEWS:1.1169 php4/NEWS:1.1170 --- php4/NEWS:1.1169Wed Oct 2 04:14:47 2002 +++ php4/NEWS Wed Oct 2 11:36:28 2002 @@ -5,7 +5,7 @@ {PREFIX}/bin/php. If you don't disable the CGI binary, it will be installed as {PREFIX}/bin/php-cgi. - Fixed bug #17825 (ob_start() chunk size option didn't work well). (Yasuo) -- Fixed output buffering implicit flush. (Yasuo) +- Fixed output buffering implicit flush. (Yasuo, Marcus) - Added getopt() for parsing command line options and arguments. (Jon) - Added pg_fetch_assoc(), pg_fetch_all(), pg_ping(), pg_meta_data(), pg_convert(), pg_insert(), pg_select(), pg_update(), pg_delete(), pg_data_seek() and Index: php4/main/output.c diff -u php4/main/output.c:1.127 php4/main/output.c:1.128 --- php4/main/output.c:1.127Wed Oct 2 11:10:11 2002 +++ php4/main/output.c Wed Oct 2 11:36:29 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: output.c,v 1.127 2002/10/02 15:10:11 helly Exp $ */ +/* $Id: output.c,v 1.128 2002/10/02 15:36:29 helly Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -595,13 +595,11 @@ /* 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) { + if (PG(implicit_flush) || OG(implicit_flush) + /* Also flush after each chunk if output is chunked */ + || (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; if (output_handler) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
helly Wed Oct 2 11:40:58 2002 EDT Modified files: /php4 NEWS Log: Better... Index: php4/NEWS diff -u php4/NEWS:1.1170 php4/NEWS:1.1171 --- php4/NEWS:1.1170Wed Oct 2 11:36:28 2002 +++ php4/NEWS Wed Oct 2 11:40:57 2002 @@ -194,7 +194,7 @@ do 'LIST -R' instead of 'LIST'. (Jani) - Disabled the fifth parameter in mail() when safe-mode is turned on. (Derick) - Changed getimagesize() to always set unknown fields to 0 and added support - iff imagetype. (Marcus) + for iff imagetype. (Marcus) - Added runtime Apache2 thread check to ensure we don't run a non-threaded PHP inside a threaded Apache2 MPM. (Rasmus) - Made getimagesize() and exif_read_data() to return also the mime-type and -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/curl curl.c
derick Wed Oct 2 12:44:49 2002 EDT Modified files: /php4/ext/curl curl.c Log: - Added CURLOPT_FTP_USE_EPSV option. (Patch by Alex Howansky <[EMAIL PROTECTED]>) Index: php4/ext/curl/curl.c diff -u php4/ext/curl/curl.c:1.118 php4/ext/curl/curl.c:1.119 --- php4/ext/curl/curl.c:1.118 Mon Aug 12 11:56:13 2002 +++ php4/ext/curl/curl.cWed Oct 2 12:44:48 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: curl.c,v 1.118 2002/08/12 15:56:13 wez Exp $ */ +/* $Id: curl.c,v 1.119 2002/10/02 16:44:48 derick Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -137,6 +137,7 @@ REGISTER_CURL_CONSTANT(CURLOPT_REFERER); REGISTER_CURL_CONSTANT(CURLOPT_USERAGENT); REGISTER_CURL_CONSTANT(CURLOPT_FTPPORT); + REGISTER_CURL_CONSTANT(CURLOPT_FTP_USE_EPSV); REGISTER_CURL_CONSTANT(CURLOPT_LOW_SPEED_LIMIT); REGISTER_CURL_CONSTANT(CURLOPT_LOW_SPEED_TIME); REGISTER_CURL_CONSTANT(CURLOPT_RESUME_FROM); @@ -659,6 +660,7 @@ case CURLOPT_PUT: case CURLOPT_MUTE: case CURLOPT_TIMEOUT: + case CURLOPT_FTP_USE_EPSV: case CURLOPT_LOW_SPEED_LIMIT: case CURLOPT_SSLVERSION: case CURLOPT_LOW_SPEED_TIME: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard string.c
andrey Wed Oct 2 13:56:05 2002 EDT Modified files: /php4/ext/standard string.c Log: ws fixes. Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.300 php4/ext/standard/string.c:1.301 --- php4/ext/standard/string.c:1.300Thu Sep 26 15:18:35 2002 +++ php4/ext/standard/string.c Wed Oct 2 13:56:04 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.300 2002/09/26 19:18:35 sebastian Exp $ */ +/* $Id: string.c,v 1.301 2002/10/02 17:56:04 andrey Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -113,11 +113,11 @@ size_t i, j; result = (char *) emalloc(oldlen * 2 * sizeof(char) + 1); - if(!result) { + if (!result) { return result; } - for(i = j = 0; i < oldlen; i++) { + for (i = j = 0; i < oldlen; i++) { result[j++] = hexconvtab[old[i] >> 4]; result[j++] = hexconvtab[old[i] & 15]; } @@ -491,21 +491,21 @@ int result = SUCCESS; memset(mask, 0, 256); - for (end=input+len; input= c) { memset(mask+c, 1, input[3] - c + 1); input+=3; - } else if (input+1=input) { /* there was no 'left' char */ + if (end-len >= input) { /* there was no 'left' char */ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, no character to the left of '..'."); result = FAILURE; continue; } - if (input+2>=end) { /* there is no 'right' char */ + if (input+2 >= end) { /* there is no 'right' char */ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, no character to the right of '..'."); result = FAILURE; continue; @@ -984,7 +984,7 @@ c = s; e = c+len; - while (c sufflen)) { - if(!strncmp(suffix, c-sufflen+1, sufflen)) { + if (suffix && (len > sufflen)) { + if (!strncmp(suffix, c-sufflen+1, sufflen)) { c -= sufflen; buf2 = *(c + 1); /* Save overwritten char */ *(c + 1) = '\0'; /* overwrite char */ @@ -1069,7 +1069,7 @@ #endif ) c--; - if(c < s+len-1) { + if (c < s+len-1) { buf = *(c + 1); /* Save overwritten char */ *(c + 1) = '\0'; /* overwrite char */ p = c + 1; /* Save pointer to overwritten char */ @@ -1084,8 +1084,8 @@ } else { ret = estrdup(s); } - if(buf) *p = buf; - if(buf2) *p2 = buf2; + if (buf) *p = buf; + if (buf2) *p2 = buf2; return (ret); } /* }}} */ @@ -1524,7 +1524,7 @@ dest = emalloc((srclen + (chunks + 1) * endlen + 1) * sizeof(char)); - for(p = src, q = dest; p < (src + srclen - chunklen + 1); ) { + for (p = src, q = dest; p < (src + srclen - chunklen + 1); ) { memcpy(q, p, chunklen); q += chunklen; memcpy(q, end, endlen); @@ -1532,7 +1532,7 @@ p += chunklen; } - if(restlen) { + if (restlen) { memcpy(q, p, restlen); q += restlen; memcpy(q, end, endlen); @@ -1644,7 +1644,7 @@ RETURN_FALSE; } - if((f + l) > Z_STRLEN_PP(str)) { + if ((f + l) > Z_STRLEN_PP(str)) { l = Z_STRLEN_PP(str) - f; } @@ -1745,9 +1745,9 @@ str = emalloc(2 * Z_STRLEN_PP(arg) + 1); - for(p = old, q = str; p != old_end; p++) { + for (p = old, q = str; p != old_end; p++) { c = *p; - switch(c) { + switch (c) { case '.': case '\\': case '+': @@ -1991,7 +1991,7 @@ convert_to_string_ex(str); /* shortcut for empty string */ - if(Z_STRLEN_PP(str) == 0) { + if (Z_STRLEN_PP(str) == 0) { RETURN_EMPTY_STRING(); } @@ -2020,7 +2020,7 @@ int i, len; char c; - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &str)==FAILURE) { + if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &str) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(str); @@ -2136,15 +2136,15 @@ if (PG(magic_quotes_sybase)) { while (l > 0) { - if(*t=='\'') { - if((l>0) && (t[1]=='\'')) { + if (*t == '\'') { + if ((l > 0) &
[PHP-CVS] cvs: php4 /ext/standard string.c
andrey Wed Oct 2 14:13:57 2002 EDT Modified files: /php4/ext/standard string.c Log: Ws fix. Forgot to add this in the previous commit. Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.301 php4/ext/standard/string.c:1.302 --- php4/ext/standard/string.c:1.301Wed Oct 2 13:56:04 2002 +++ php4/ext/standard/string.c Wed Oct 2 14:13:56 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.301 2002/10/02 17:56:04 andrey Exp $ */ +/* $Id: string.c,v 1.302 2002/10/02 18:13:56 andrey Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -450,10 +450,9 @@ convert_to_long_ex(item); value = nl_langinfo(Z_LVAL_PP(item)); - if (value == NULL) { + if (value == NULL) { RETURN_FALSE; - } - else{ + } else { RETURN_STRING(value, 1); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard string.c
andrey Wed Oct 2 14:41:55 2002 EDT Modified files: /php4/ext/standard string.c Log: Making strstr() binary safe. Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.302 php4/ext/standard/string.c:1.303 --- php4/ext/standard/string.c:1.302Wed Oct 2 14:13:56 2002 +++ php4/ext/standard/string.c Wed Oct 2 14:41:55 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.302 2002/10/02 18:13:56 andrey Exp $ */ +/* $Id: string.c,v 1.303 2002/10/02 18:41:55 andrey Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -1360,6 +1360,7 @@ zval **haystack, **needle; char *found = NULL; char needle_char[2]; + long found_offset; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &haystack, &needle) == FAILURE) { @@ -1387,7 +1388,8 @@ } if (found) { - RETURN_STRING(found, 1); + found_offset = found - Z_STRVAL_PP(haystack); + RETURN_STRINGL(found, Z_STRLEN_PP(haystack) - found_offset, 1); } else { RETURN_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard string.c /ext/standard/tests/strings 002.phpt
andrey Wed Oct 2 14:58:10 2002 EDT Added files: /php4/ext/standard/tests/strings002.phpt Modified files: /php4/ext/standard string.c Log: Making strrchr() binary safe. Test case added. Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.303 php4/ext/standard/string.c:1.304 --- php4/ext/standard/string.c:1.303Wed Oct 2 14:41:55 2002 +++ php4/ext/standard/string.c Wed Oct 2 14:58:09 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.303 2002/10/02 18:41:55 andrey Exp $ */ +/* $Id: string.c,v 1.304 2002/10/02 18:58:09 andrey Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -1487,6 +1487,7 @@ { zval **haystack, **needle; char *found = NULL; + long found_offset; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &haystack, &needle) == FAILURE) { @@ -1503,7 +1504,8 @@ } if (found) { - RETURN_STRING(found, 1); + found_offset = found - Z_STRVAL_PP(haystack); + RETURN_STRINGL(found, Z_STRLEN_PP(haystack) - found_offset, 1); } else { RETURN_FALSE; } Index: php4/ext/standard/tests/strings/002.phpt +++ php4/ext/standard/tests/strings/002.phpt --TEST-- Test whether strstr() and strrchr() are binary safe. --POST-- --GET-- --FILE-- --EXPECT-- int(18) int(19) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/apache2filter php_functions.c
iliaa Wed Oct 2 17:22:45 2002 EDT Modified files: /php4/sapi/apache2filterphp_functions.c Log: Added apache_response_headers(), apache_note(), apache_getenv() and apache_setenv() functions. The getallheaders() is renamed to apache_request_headers() and an getallheaders() is aliased to it. Added a better error reporting mechanism to apache_lookup_uri() and virtual(). Index: php4/sapi/apache2filter/php_functions.c diff -u php4/sapi/apache2filter/php_functions.c:1.27 php4/sapi/apache2filter/php_functions.c:1.28 --- php4/sapi/apache2filter/php_functions.c:1.27Fri Sep 20 21:53:15 2002 +++ php4/sapi/apache2filter/php_functions.c Wed Oct 2 17:22:44 2002 @@ -35,36 +35,47 @@ #include "php_apache.h" -static request_rec *php_apache_lookup_uri(INTERNAL_FUNCTION_PARAMETERS) +static request_rec *php_apache_lookup_uri(char *filename) { - zval **p1; php_struct *ctx; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &p1) == FAILURE) + if (!filename) { return NULL; - - convert_to_string_ex(p1); - + } + ctx = SG(server_context); - return ap_sub_req_lookup_uri(Z_STRVAL_PP(p1), ctx->f->r, ctx->f->next); + return ap_sub_req_lookup_uri(filename, ctx->f->r, ctx->f->next); } /* {{{ proto bool virtual(string uri) Perform an apache sub-request */ PHP_FUNCTION(virtual) { + zval **filename; request_rec *rr; - rr = php_apache_lookup_uri(INTERNAL_FUNCTION_PARAM_PASSTHRU); - - if (!rr) + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { WRONG_PARAM_COUNT; + } + + convert_to_string_ex(filename); + + if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - +URI lookup failed", Z_STRVAL_PP(filename)); + RETURN_FALSE; + } if (rr->status == HTTP_OK) { - ap_run_sub_req(rr); + if (ap_run_sub_req(rr)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include +'%s' - request execution failed", Z_STRVAL_PP(filename)); + ap_destroy_sub_req(rr); + RETURN_FALSE; + } ap_destroy_sub_req(rr); RETURN_TRUE; } + + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error +finding URI", Z_STRVAL_PP(filename)); ap_destroy_sub_req(rr); RETURN_FALSE; } @@ -79,10 +90,18 @@ PHP_FUNCTION(apache_lookup_uri) { request_rec *rr; + zval **filename; - rr = php_apache_lookup_uri(INTERNAL_FUNCTION_PARAM_PASSTHRU); - if (!rr) + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { WRONG_PARAM_COUNT; + } + + convert_to_string_ex(filename); + + if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - +URI lookup failed", Z_STRVAL_PP(filename)); + RETURN_FALSE; + } if (rr->status == HTTP_OK) { object_init(return_value); @@ -117,13 +136,15 @@ ap_destroy_sub_req(rr); return; } + + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error +finding URI", Z_STRVAL_PP(filename)); ap_destroy_sub_req(rr); RETURN_FALSE; } /* {{{ proto array getallheaders(void) Fetch all HTTP request headers */ -PHP_FUNCTION(getallheaders) +PHP_FUNCTION(apache_request_headers) { php_struct *ctx; const apr_array_header_t *arr; @@ -143,6 +164,125 @@ } /* }}} */ +/* {{{ proto array apache_response_headers(void) + Fetch all HTTP response headers */ +PHP_FUNCTION(apache_response_headers) +{ + php_struct *ctx; + const apr_array_header_t *arr; + char *key, *val; + + if (array_init(return_value) == FAILURE) { + RETURN_FALSE; + } + + ctx = SG(server_context); + arr = apr_table_elts(ctx->f->r->headers_out); + + APR_ARRAY_FOREACH_OPEN(arr, key, val) + if (!val) val = empty_string; + add_assoc_string(return_value, key, val, 1); + APR_ARRAY_FOREACH_CLOSE() +} +/* }}} */ + +/* {{{ proto string apache_note(string note_name [, string note_value]) + Get and set Apache request notes */ +PHP_FUNCTION(apache_note) +{ + php_struct *ctx; + zval **note_name, **note_val; + char *old_note_val=NULL; + int arg_count = ZEND_NUM_ARGS(); + + if (arg_count<1 || arg_count>2 || + zend_get_parameters_ex(arg_count, ¬e_name, ¬e_val) == FAILURE) { + WRONG_PARAM_COUNT; + } + + ctx = SG(server_
[PHP-CVS] cvs: php4 / NEWS
iliaa Wed Oct 2 17:34:02 2002 EDT Modified files: /php4 NEWS Log: Notes about additions to Apache 2 sapi. Index: php4/NEWS diff -u php4/NEWS:1.1171 php4/NEWS:1.1172 --- php4/NEWS:1.1171Wed Oct 2 11:40:57 2002 +++ php4/NEWS Wed Oct 2 17:34:01 2002 @@ -1,6 +1,12 @@ PHP 4 NEWS ||| ? ? ??? 2002, Version 4.3.0 +- A few additions to Apache 2 sapi (Ilia) + . Added apache_response_headers(), apache_note(), apache_getenv() and +apache_setenv() functions. + . Added more detailed error reporting to apache_lookup_uri() and virtual(). + . Renamed getallheaders() to apache_request_headers() and made an alias for BC. + . Added php_apache_sapi_getenv() and php_apache_sapi_get_stat(). - ATTENTION! "make install" will *by default* install the CLI SAPI binary in {PREFIX}/bin/php. If you don't disable the CGI binary, it will be installed as {PREFIX}/bin/php-cgi. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/session session.c
sas Wed Oct 2 17:51:32 2002 EDT Modified files: /php4/ext/session session.c Log: Fix harmless memory leaks and simplify track_vars_init. Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.323 php4/ext/session/session.c:1.324 --- php4/ext/session/session.c:1.323Tue Oct 1 07:59:45 2002 +++ php4/ext/session/session.c Wed Oct 2 17:51:32 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: session.c,v 1.323 2002/10/01 11:59:45 sas Exp $ */ +/* $Id: session.c,v 1.324 2002/10/02 21:51:32 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -258,7 +258,9 @@ if (sym_global == NULL && sym_track == NULL) { zval *empty_var; - ALLOC_INIT_ZVAL(empty_var); + ALLOC_INIT_ZVAL(empty_var); /* this sets refcount to 1 */ + ZVAL_DELREF(empty_var); /* our module does not maintain a ref +*/ + /* The next call will increase refcount by NR_OF_SYM_TABLES==2 +*/ zend_set_hash_symbol(empty_var, name, namelen, 1, 2, Z_ARRVAL_P(PS(http_session_vars)), &EG(symbol_table)); } else if (sym_global == NULL) { zend_set_hash_symbol(*sym_track, name, namelen, 1, 1, &EG(symbol_table)); @@ -270,7 +272,7 @@ zval *empty_var; ALLOC_INIT_ZVAL(empty_var); - zend_set_hash_symbol(empty_var, name, namelen, 0, 1, Z_ARRVAL_P(PS(http_session_vars))); + ZEND_SET_SYMBOL_WITH_LENGTH(Z_ARRVAL_P(PS(http_session_vars)), +name, namelen+1, empty_var, 1, 0); } } } @@ -465,23 +467,16 @@ static void php_session_track_init(TSRMLS_D) { - zval **old_vars = NULL; + /* Unconditionally destroy existing arrays -- possible dirty data */ + zend_hash_del(&EG(symbol_table), "HTTP_SESSION_VARS", + sizeof("HTTP_SESSION_VARS")); + zend_hash_del(&EG(symbol_table), "_SESSION", sizeof("_SESSION")); - if (zend_hash_find(&EG(symbol_table), "HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS"), (void **)&old_vars) == SUCCESS && Z_TYPE_PP(old_vars) == IS_ARRAY) { - PS(http_session_vars) = *old_vars; - zend_hash_clean(Z_ARRVAL_P(PS(http_session_vars))); - } else { - if(old_vars) { - zend_hash_del(&EG(symbol_table), "HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS")); - zend_hash_del(&EG(symbol_table), "_SESSION", sizeof("_SESSION")); - } - MAKE_STD_ZVAL(PS(http_session_vars)); - array_init(PS(http_session_vars)); - PS(http_session_vars)->refcount = 2; - PS(http_session_vars)->is_ref = 1; - zend_hash_update(&EG(symbol_table), "HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS"), &PS(http_session_vars), sizeof(zval *), NULL); - zend_hash_update(&EG(symbol_table), "_SESSION", sizeof("_SESSION"), &PS(http_session_vars), sizeof(zval *), NULL); - } + MAKE_STD_ZVAL(PS(http_session_vars)); + array_init(PS(http_session_vars)); + + ZEND_SET_GLOBAL_VAR("HTTP_SESSION_VARS", PS(http_session_vars)); + ZEND_SET_GLOBAL_VAR("_SESSION", PS(http_session_vars)); } static char *php_session_encode(int *newlen TSRMLS_DC) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / run-tests.php /ext/bz2/tests .cvsignore /ext/crack/tests .cvsignore /ext/ctype/tests .cvsignore /ext/cybermut/tests .cvsignore /ext/db/tests .cvsignore /ext/dbx/tests .cvsignore /ext/dio/tests .cvsignore /ext/domxml/tests .cvsignore /ext/exif/tests .cvsignore /ext/gmp/tests .cvsignore /ext/iconv/tests .cvsignore /ext/interbase/tests .cvsignore /ext/mbstring/tests .cvsignore /ext/mcrypt/tests .cvsignore /ext/mcve/tests .cvsignore /ext/ncurses/tests .cvsignore /ext/openssl/tests .cvsignore /ext/pcntl/tests .cvsignore /ext/pgsql/tests .cvsignore /ext/pspell/tests .cvsignore /ext/session/tests .cvsignore /ext/skeleton/tests .cvsignore /ext/standard/tests .cvsignore /ext/standard/tests/aggregation .cvsignore /ext/standard/tests/array .cvsignore /ext/standard/tests/assert .cvsignore /ext/standard/tests/file .cvsignore /ext/standard/tests/general_functions .cvsignore /ext/standard/tests/math .cvsignore /ext/standard/tests/reg .cvsignore /ext/standard/tests/serialize .cvsignore /ext/standard/tests/strings .cvsignore /ext/standard/tests/time .cvsignore /ext/standard/tests/versioning .cvsignore /ext/sysvmsg/tests .cvsignore /ext/xml/tests .cvsignore /ext/xslt/tests .cvsignore /ext/zip/tests .cvsignore /ext/zlib/tests .cvsignore /pear/Console/tests .cvsignore /pear/tests .cvsignore /tests .cvsignore /tests/basic .cvsignore /tests/classes .cvsignore /tests/func .cvsignore /tests/lang .cvsignore /tests/strings .cvsignore
sniper Wed Oct 2 18:31:38 2002 EDT Modified files: /php4 run-tests.php /php4/ext/bz2/tests .cvsignore /php4/ext/crack/tests .cvsignore /php4/ext/ctype/tests .cvsignore /php4/ext/cybermut/tests.cvsignore /php4/ext/db/tests .cvsignore /php4/ext/dbx/tests .cvsignore /php4/ext/dio/tests .cvsignore /php4/ext/domxml/tests .cvsignore /php4/ext/exif/tests.cvsignore /php4/ext/gmp/tests .cvsignore /php4/ext/iconv/tests .cvsignore /php4/ext/interbase/tests .cvsignore /php4/ext/mbstring/tests.cvsignore /php4/ext/mcrypt/tests .cvsignore /php4/ext/mcve/tests.cvsignore /php4/ext/ncurses/tests .cvsignore /php4/ext/openssl/tests .cvsignore /php4/ext/pcntl/tests .cvsignore /php4/ext/pgsql/tests .cvsignore /php4/ext/pspell/tests .cvsignore /php4/ext/session/tests .cvsignore /php4/ext/skeleton/tests.cvsignore /php4/ext/standard/tests.cvsignore /php4/ext/standard/tests/aggregation.cvsignore /php4/ext/standard/tests/array .cvsignore /php4/ext/standard/tests/assert .cvsignore /php4/ext/standard/tests/file .cvsignore /php4/ext/standard/tests/general_functions .cvsignore /php4/ext/standard/tests/math .cvsignore /php4/ext/standard/tests/reg.cvsignore /php4/ext/standard/tests/serialize .cvsignore /php4/ext/standard/tests/strings.cvsignore /php4/ext/standard/tests/time .cvsignore /php4/ext/standard/tests/versioning .cvsignore /php4/ext/sysvmsg/tests .cvsignore /php4/ext/xml/tests .cvsignore /php4/ext/xslt/tests.cvsignore /php4/ext/zip/tests .cvsignore /php4/ext/zlib/tests.cvsignore /php4/pear/Console/tests.cvsignore /php4/pear/tests.cvsignore /php4/tests .cvsignore /php4/tests/basic .cvsignore /php4/tests/classes .cvsignore /php4/tests/func.cvsignore /php4/tests/lang.cvsignore /php4/tests/strings .cvsignore Log: unify these files to conform with the new files created by run-tests.php Index: php4/run-tests.php diff -u php4/run-tests.php:1.56 php4/run-tests.php:1.57 --- php4/run-tests.php:1.56 Tue Oct 1 21:52:25 2002 +++ php4/run-tests.php Wed Oct 2 18:31:26 2002 @@ -333,7 +333,7 @@ @unlink(ereg_replace('\.phpt$','.exp',$file)); @unlink(ereg_replace('\.phpt$','.out',$file)); -// Check if test should be skipped. + // Check if test should be skipped. if (array_key_exists('SKIPIF', $section_text)) { if (trim($section_text['SKIPIF'])) { save_text($tmp_skipif, $section_text['SKIPIF']); Index: php4/ext/bz2/tests/.cvsignore diff -u php4/ext/bz2/tests/.cvsignore:1.2 php4/ext/bz2/tests/.cvsignore:1.3 --- php4/ext/bz2/tests/.cvsignore:1.2 Sun May 19 09:53:59 2002 +++ php4/ext/bz2/tests/.cvsignore Wed Oct 2 18:31:27 2002 @@ -1,2 +1,4 @@ +*.diff *.log -phpt.* +*.exp +*.out Index: php4/ext/crack/tests/.cvsignore diff -u php4/ext/crack/tests/.cvsignore:1.2 php4/ext/crack/tests/.cvsignore:1.3 --- php4/ext/crack/tests/.cvsignore:1.2 Sun May 19 09:54:00 2002 +++ php4/ext/crack/tests/.cvsignore Wed Oct 2 18:31:27 2002 @@ -1,2 +1,4 @@ +*.diff *.log -phpt.* +*.exp +*.out Index: php4/ext/ctype/tests/.cvsignore diff -u php4/ext/ctype/tests/.cvsignore:1.2 php4/ext/ctype/tests/.cvsignore:1.3 --- php4/ext/ctype/tests/.cvsignore:1.2 Sun May 19 09:54:00 2002 +++ php4/ext/ctype/tests/.cvsignore Wed Oct 2 18:31:27 2002 @@ -1,2 +1,4 @@ +*.diff *.log -phpt.* +*.exp +*.out Index: php4/ext/cybermut/tests/.cvsignore diff -u php4/ext/cybermut/tests/.cvsignore:1.2 php4/ext/cybermut/tests/.cvsignore:1.3 --- php4/ext/cybermut/tests/.cvsignore:1.2 Sun May 19 09:54:00 2002 +++ php4/ext/cybermut/tests/.cvsignore Wed Oct 2 18:31:27 2002 @@ -1,2 +1,4 @@ +*.diff *.log -phpt.* +*.exp +*.out Index: php4/ext/db/tests/.cvsignore diff -u php4/ext/db/tests/.cvsignore:1.3 php4/ext/db/tests/.cvsignore:1.4 --- php4/ext/db/tests/.cvsignore:1.3Sun May 19 09:54:01 2002 +++ php4/ext/db/tests/.cvsignoreWed Oct 2 18:31:27 2002 @@ -1,3 +1,5 @@ +*.diff *.log -phpt.* +*.exp +*.out test.dbm Index: php4/ext/dbx/tests/.cvsignore diff -u php4/ext/dbx/tests/.cvsignore:1.2 php4/ext/dbx/tests/.cvsignore:1.3 --- php4/ext/dbx/tests/.cvsignore:1.2 Sun May 19 09:54:01 2002 +++ php4/ext/dbx/tests/.cvsignore Wed Oct 2 18:31:28 2002 @@ -1,2 +1,4 @@ +*.diff *.log -phpt.* +*.exp +*.out Index: php4/ext/dio/tests/.cvsignore diff -u php4/ext/dio/tests/.cvsignore:1.2 php4/ext/dio/tests/.cvsignore:1.3 --- php4/ext/dio/tests/.cvsignore:1.2 Sun May 19 09:54:02 2002 +++ php4/ext/dio/tests/.cvsignore Wed Oct 2 18:31:28 2002 @@ -1,2 +1,4 @@ +*.diff *.log -phpt.* +*.exp +*.out Index: php4/ext/domxml/tests/.cvsignore diff -u ph
[PHP-CVS] cvs: php4 / NEWS
sniper Wed Oct 2 18:34:41 2002 EDT Modified files: /php4 NEWS Log: stylissimo Index: php4/NEWS diff -u php4/NEWS:1.1172 php4/NEWS:1.1173 --- php4/NEWS:1.1172Wed Oct 2 17:34:01 2002 +++ php4/NEWS Wed Oct 2 18:34:40 2002 @@ -1,15 +1,15 @@ PHP 4 NEWS ||| ? ? ??? 2002, Version 4.3.0 -- A few additions to Apache 2 sapi (Ilia) +- ATTENTION! "make install" will *by default* install the CLI SAPI binary in + {PREFIX}/bin/php. If you don't disable the CGI binary, it will be + installed as {PREFIX}/bin/php-cgi. +- Made a few additions and changes to Apache 2 sapi. (Ilia) . Added apache_response_headers(), apache_note(), apache_getenv() and apache_setenv() functions. . Added more detailed error reporting to apache_lookup_uri() and virtual(). . Renamed getallheaders() to apache_request_headers() and made an alias for BC. . Added php_apache_sapi_getenv() and php_apache_sapi_get_stat(). -- ATTENTION! "make install" will *by default* install the CLI SAPI binary in - {PREFIX}/bin/php. If you don't disable the CGI binary, it will be - installed as {PREFIX}/bin/php-cgi. - Fixed bug #17825 (ob_start() chunk size option didn't work well). (Yasuo) - Fixed output buffering implicit flush. (Yasuo, Marcus) - Added getopt() for parsing command line options and arguments. (Jon) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/interbase interbase.c
daniela Wed Oct 2 19:05:08 2002 EDT Modified files: /php4/ext/interbase interbase.c Log: syntax to avoid error while reading data from file in ibase_blob_import Index: php4/ext/interbase/interbase.c diff -u php4/ext/interbase/interbase.c:1.90 php4/ext/interbase/interbase.c:1.91 --- php4/ext/interbase/interbase.c:1.90 Wed Sep 25 11:46:44 2002 +++ php4/ext/interbase/interbase.c Wed Oct 2 19:05:06 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: interbase.c,v 1.90 2002/09/25 15:46:44 wez Exp $ */ +/* $Id: interbase.c,v 1.91 2002/10/02 23:05:06 daniela Exp $ */ /* TODO: Arrays, roles? @@ -609,7 +609,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "Interbase Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.90 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.91 $"); #ifdef COMPILE_DL_INTERBASE php_info_print_table_row(2, "Dynamic Module", "yes"); #endif @@ -2882,8 +2882,7 @@ ibase_blob_handle ib_blob; ibase_db_link *ib_link; char bl_data[IBASE_BLOB_SEG]; /* FIXME? blob_seg_size parameter? */ - int type; - php_stream * stream; + php_stream *stream; RESET_ERRMSG; @@ -2926,7 +2925,7 @@ size = 0; - while(b = php_stream_read(stream, bl_data, sizeof(bl_data)) > 0){ + while( (b = php_stream_read(stream, bl_data, sizeof(bl_data)) ) > 0){ if (isc_put_segment(IB_STATUS, &ib_blob.bl_handle, b, bl_data)) { _php_ibase_error(TSRMLS_C); RETURN_FALSE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main safe_mode.c
dreid Wed Oct 2 19:48:59 2002 EDT Modified files: /php4/main safe_mode.c Log: Add some more BeOS support. Index: php4/main/safe_mode.c diff -u php4/main/safe_mode.c:1.49 php4/main/safe_mode.c:1.50 --- php4/main/safe_mode.c:1.49 Sun Aug 25 14:45:02 2002 +++ php4/main/safe_mode.c Wed Oct 2 19:48:58 2002 @@ -15,7 +15,7 @@ | Author: Rasmus Lerdorf <[EMAIL PROTECTED]>| +--+ */ -/* $Id: safe_mode.c,v 1.49 2002/08/25 18:45:02 helly Exp $ */ +/* $Id: safe_mode.c,v 1.50 2002/10/02 23:48:58 dreid Exp $ */ #include "php.h" @@ -31,6 +31,9 @@ #include "SAPI.h" #include "php_globals.h" +#ifdef __BEOS__ +#define realpath(x,y) strcpy(y,x) +#endif /* * php_checkuid -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard file.c
dreid Wed Oct 2 19:52:08 2002 EDT Modified files: /php4/ext/standard file.c Log: Add more BeOS support... Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.266 php4/ext/standard/file.c:1.267 --- php4/ext/standard/file.c:1.266 Sat Sep 28 18:14:21 2002 +++ php4/ext/standard/file.cWed Oct 2 19:52:08 2002 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.266 2002/09/28 22:14:21 wez Exp $ */ +/* $Id: file.c,v 1.267 2002/10/02 23:52:08 dreid Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -113,6 +113,10 @@ #ifdef HAVE_FNMATCH #include +#endif + +#ifdef __BEOS__ +#define realpath(x,y) strcpy(y,x) #endif /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/apache2filter php_functions.c
iliaa Wed Oct 2 21:28:04 2002 EDT Modified files: /php4/sapi/apache2filterphp_functions.c Log: Added missing TSRMLS_DC to php_apache_lookup_uri() Index: php4/sapi/apache2filter/php_functions.c diff -u php4/sapi/apache2filter/php_functions.c:1.28 php4/sapi/apache2filter/php_functions.c:1.29 --- php4/sapi/apache2filter/php_functions.c:1.28Wed Oct 2 17:22:44 2002 +++ php4/sapi/apache2filter/php_functions.c Wed Oct 2 21:28:04 2002 @@ -35,7 +35,7 @@ #include "php_apache.h" -static request_rec *php_apache_lookup_uri(char *filename) +static request_rec *php_apache_lookup_uri(char *filename TSRMLS_DC) { php_struct *ctx; @@ -60,7 +60,7 @@ convert_to_string_ex(filename); - if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename { + if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename) TSRMLS_CC))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", Z_STRVAL_PP(filename)); RETURN_FALSE; } @@ -98,7 +98,7 @@ convert_to_string_ex(filename); - if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename { + if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename) TSRMLS_CC))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", Z_STRVAL_PP(filename)); RETURN_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c /main output.c php_output.h
yohgaki Wed Oct 2 21:36:44 2002 EDT Modified files: /php4/ext/standard basic_functions.c /php4/main output.c php_output.h Log: Added ob_get_clean() and ob_get_flush(). Someone requested this feature before. @ Added ob_get_clean() and og_get_flush(). (Yasuo) Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.516 php4/ext/standard/basic_functions.c:1.517 --- php4/ext/standard/basic_functions.c:1.516 Sun Sep 29 23:02:51 2002 +++ php4/ext/standard/basic_functions.c Wed Oct 2 21:36:43 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.516 2002/09/30 03:02:51 jon Exp $ */ +/* $Id: basic_functions.c,v 1.517 2002/10/03 01:36:43 yohgaki Exp $ */ #include "php.h" #include "php_streams.h" @@ -750,6 +750,8 @@ PHP_FE(ob_clean, NULL) PHP_FE(ob_end_flush, NULL) PHP_FE(ob_end_clean, NULL) + PHP_FE(ob_get_flush, + NULL) + PHP_FE(ob_get_clean, + NULL) PHP_FE(ob_get_length, NULL) PHP_FE(ob_get_level, NULL) PHP_FE(ob_get_status, NULL) Index: php4/main/output.c diff -u php4/main/output.c:1.128 php4/main/output.c:1.129 --- php4/main/output.c:1.128Wed Oct 2 11:36:29 2002 +++ php4/main/output.c Wed Oct 2 21:36:44 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: output.c,v 1.128 2002/10/02 15:36:29 helly Exp $ */ +/* $Id: output.c,v 1.129 2002/10/03 01:36:44 yohgaki Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -818,6 +818,56 @@ php_end_ob_buffer(0, 0 TSRMLS_CC); RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ob_get_flush(void) + Get current buffer contents, flush (send) the output buffer, and delete current +output buffer */ +PHP_FUNCTION(ob_get_flush) +{ + if (ZEND_NUM_ARGS() != 0) + WRONG_PARAM_COUNT; + + /* get contents */ + if (php_ob_get_buffer(return_value TSRMLS_CC)==FAILURE) { + RETURN_FALSE; + } + /* error checks */ + if (!OG(ob_nesting_level)) { + php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to +delete and flush buffer. No buffer to delete or flush."); + RETURN_FALSE; + } + if (OG(ob_nesting_level) && !OG(active_ob_buffer).status && +!OG(active_ob_buffer).erase) { + php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to +delete buffer %s.", OG(active_ob_buffer).handler_name); + RETURN_FALSE; + } + /* flush */ + php_end_ob_buffer(1, 0 TSRMLS_CC); +} +/* }}} */ + +/* {{{ proto bool ob_get_clean(void) + Get current buffer contents and delete current output buffer */ +PHP_FUNCTION(ob_get_clean) +{ + if (ZEND_NUM_ARGS() != 0) + WRONG_PARAM_COUNT; + + /* get contents */ + if (php_ob_get_buffer(return_value TSRMLS_CC)==FAILURE) { + RETURN_FALSE; + } + /* error checks */ + if (!OG(ob_nesting_level)) { + php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to +delete buffer. No buffer to delete."); + RETURN_FALSE; + } + if (OG(ob_nesting_level) && !OG(active_ob_buffer).status && +!OG(active_ob_buffer).erase) { + php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to +delete buffer %s.", OG(active_ob_buffer).handler_name); + RETURN_FALSE; + } + /* delete buffer */ + php_end_ob_buffer(0, 0 TSRMLS_CC); } /* }}} */ Index: php4/main/php_output.h diff -u php4/main/php_output.h:1.43 php4/main/php_output.h:1.44 --- php4/main/php_output.h:1.43 Sun Sep 1 07:33:19 2002 +++ php4/main/php_output.h Wed Oct 2 21:36:44 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_output.h,v 1.43 2002/09/01 11:33:19 sebastian Exp $ */ +/* $Id: php_output.h,v 1.44 2002/10/03 01:36:44 yohgaki Exp $ */ #ifndef PHP_OUTPUT_H #define PHP_OUTPUT_H
[PHP-CVS] cvs: php4 /ext/mysql php_mysql.c /ext/pgsql pgsql.c php_pgsql.h
yohgaki Wed Oct 2 22:32:09 2002 EDT Modified files: /php4/ext/mysql php_mysql.c /php4/ext/pgsql pgsql.c php_pgsql.h Log: Rename pg_data_seek() to pg_result_seek(). Added mysql_result_seek() which is alias of mysql_data_seek(). Index: php4/ext/mysql/php_mysql.c diff -u php4/ext/mysql/php_mysql.c:1.161 php4/ext/mysql/php_mysql.c:1.162 --- php4/ext/mysql/php_mysql.c:1.161Wed Sep 11 17:06:52 2002 +++ php4/ext/mysql/php_mysql.c Wed Oct 2 22:32:09 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_mysql.c,v 1.161 2002/09/11 21:06:52 derick Exp $ */ +/* $Id: php_mysql.c,v 1.162 2002/10/03 02:32:09 yohgaki Exp $ */ /* TODO: * @@ -193,6 +193,7 @@ PHP_FALIAS(mysql_dbname,mysql_result, NULL) PHP_FALIAS(mysql_tablename, mysql_result, NULL) PHP_FALIAS(mysql_table_name,mysql_result, NULL) + PHP_FALIAS(mysql_result_seek, mysql_data_seek,NULL) {NULL, NULL, NULL} }; /* }}} */ Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.230 php4/ext/pgsql/pgsql.c:1.231 --- php4/ext/pgsql/pgsql.c:1.230Wed Oct 2 02:30:40 2002 +++ php4/ext/pgsql/pgsql.c Wed Oct 2 22:32:09 2002 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.230 2002/10/02 06:30:40 yohgaki Exp $ */ +/* $Id: pgsql.c,v 1.231 2002/10/03 02:32:09 yohgaki Exp $ */ #include @@ -100,9 +100,9 @@ PHP_FE(pg_fetch_array, NULL) PHP_FE(pg_fetch_object, NULL) PHP_FE(pg_fetch_all,NULL) - PHP_FE(pg_data_seek,NULL) PHP_FE(pg_affected_rows,NULL) PHP_FE(pg_get_result, NULL) + PHP_FE(pg_result_seek, NULL) PHP_FE(pg_result_status,NULL) PHP_FE(pg_free_result, NULL) PHP_FE(pg_last_oid, NULL) @@ -1417,9 +1417,9 @@ } /* }}} */ -/* {{{ proto mixed pg_data_seek(resource result, int offset) +/* {{{ proto mixed pg_result_seek(resource result, int offset) Set internal row offset */ -PHP_FUNCTION(pg_data_seek) +PHP_FUNCTION(pg_result_seek) { zval *result; int row; Index: php4/ext/pgsql/php_pgsql.h diff -u php4/ext/pgsql/php_pgsql.h:1.51 php4/ext/pgsql/php_pgsql.h:1.52 --- php4/ext/pgsql/php_pgsql.h:1.51 Tue Oct 1 23:16:35 2002 +++ php4/ext/pgsql/php_pgsql.h Wed Oct 2 22:32:09 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_pgsql.h,v 1.51 2002/10/02 03:16:35 yohgaki Exp $ */ +/* $Id: php_pgsql.h,v 1.52 2002/10/03 02:32:09 yohgaki Exp $ */ #ifndef PHP_PGSQL_H #define PHP_PGSQL_H @@ -83,9 +83,9 @@ PHP_FUNCTION(pg_fetch_result); PHP_FUNCTION(pg_fetch_row); PHP_FUNCTION(pg_fetch_all); -PHP_FUNCTION(pg_data_seek); PHP_FUNCTION(pg_affected_rows); PHP_FUNCTION(pg_get_result); +PHP_FUNCTION(pg_result_seek); PHP_FUNCTION(pg_result_status); PHP_FUNCTION(pg_free_result); PHP_FUNCTION(pg_last_oid); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
yohgaki Wed Oct 2 22:41:20 2002 EDT Modified files: /php4 NEWS Log: Rename pg_data_seek() to pg_result_seek(). Give a correct credit for Marcus and Wez. Index: php4/NEWS diff -u php4/NEWS:1.1173 php4/NEWS:1.1174 --- php4/NEWS:1.1173Wed Oct 2 18:34:40 2002 +++ php4/NEWS Wed Oct 2 22:41:19 2002 @@ -11,10 +11,11 @@ . Renamed getallheaders() to apache_request_headers() and made an alias for BC. . Added php_apache_sapi_getenv() and php_apache_sapi_get_stat(). - Fixed bug #17825 (ob_start() chunk size option didn't work well). (Yasuo) -- Fixed output buffering implicit flush. (Yasuo, Marcus) +- Fixed output buffer infinate loop when buffer_size became 0. (Marcus, Wez) +- Fixed output buffering implicit flush. (Yasuo) - Added getopt() for parsing command line options and arguments. (Jon) - Added pg_fetch_assoc(), pg_fetch_all(), pg_ping(), pg_meta_data(), pg_convert(), - pg_insert(), pg_select(), pg_update(), pg_delete(), pg_data_seek() and + pg_insert(), pg_select(), pg_update(), pg_delete(), pg_result_seek() and pg_unescape_bytea(). (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 /main output.c
yohgaki Wed Oct 2 22:55:19 2002 EDT Modified files: /php4/main output.c Log: Made some functions inline. Added static for unexported functions. Index: php4/main/output.c diff -u php4/main/output.c:1.129 php4/main/output.c:1.130 --- php4/main/output.c:1.129Wed Oct 2 21:36:44 2002 +++ php4/main/output.c Wed Oct 2 22:55:19 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: output.c,v 1.129 2002/10/03 01:36:44 yohgaki Exp $ */ +/* $Id: output.c,v 1.130 2002/10/03 02:55:19 yohgaki Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -45,7 +45,7 @@ php_output_globals output_globals; #endif -static int php_default_output_func(const char *str, uint str_len TSRMLS_DC) +static inline int php_default_output_func(const char *str, uint str_len TSRMLS_DC) { fwrite(str, 1, str_len, stderr); return str_len; @@ -579,7 +579,7 @@ /* {{{ php_ob_append */ -static void php_ob_append(const char *text, uint text_length TSRMLS_DC) +static inline void php_ob_append(const char *text, uint text_length TSRMLS_DC) { char *target; int original_ob_text_length; @@ -612,7 +612,7 @@ /* }}} */ #if 0 -static void php_ob_prepend(const char *text, uint text_length) +static inline void php_ob_prepend(const char *text, uint text_length) { char *p, *start; TSRMLS_FETCH(); @@ -635,7 +635,7 @@ /* {{{ php_ob_get_buffer * Return the current output buffer */ -int php_ob_get_buffer(zval *p TSRMLS_DC) +static int php_ob_get_buffer(zval *p TSRMLS_DC) { if (OG(ob_nesting_level)==0) { return FAILURE; @@ -647,7 +647,7 @@ /* {{{ php_ob_get_length * Return the size of the current output buffer */ -int php_ob_get_length(zval *p TSRMLS_DC) +static int php_ob_get_length(zval *p TSRMLS_DC) { if (OG(ob_nesting_level) == 0) { return FAILURE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/session php_session.h session.c
sas Wed Oct 2 23:23:02 2002 EDT Modified files: /php4/ext/session php_session.h session.c Log: Nuke PS(vars), we keep the state of registered session variables now completely in PS(http_session_vars). This avoids bugs which are caused by a lack of synchronization between the two hashes. We also don't need to worry about prioritizing one of them. Add session.bug_compat_42 and session.bug_compat_warn which are enabled by default. The logic behind bug_compat_42: IF bug_compat_42 is on, and IF register_globals is off, and IF any value of $_SESSION["key"] is NULL, and IF there is a global variable $key, then $_SESSION["key"] is set to $key. The extension emits this warning once per script, unless told otherwise. "Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn. Index: php4/ext/session/php_session.h diff -u php4/ext/session/php_session.h:1.82 php4/ext/session/php_session.h:1.83 --- php4/ext/session/php_session.h:1.82 Tue Oct 1 07:59:45 2002 +++ php4/ext/session/php_session.h Wed Oct 2 23:23:02 2002 @@ -103,12 +103,13 @@ zend_bool cookie_secure; ps_module *mod; void *mod_data; - HashTable vars; php_session_status session_status; long gc_probability; long gc_maxlifetime; int module_number; long cache_expire; + long bug_compat; /* Whether to behave like PHP 4.2 and earlier */ + long bug_compat_warn; /* Whether to warn about it */ const struct ps_serializer_struct *serializer; zval *http_session_vars; zend_bool auto_start; @@ -188,14 +189,12 @@ PHPAPI void php_session_start(TSRMLS_D); #define PS_ADD_VARL(name,namelen) do { \ - zend_hash_add_empty_element(&PS(vars), name, namelen + 1); \ php_add_session_var(name, namelen TSRMLS_CC); \ } while (0) #define PS_ADD_VAR(name) PS_ADD_VARL(name, strlen(name)) #define PS_DEL_VARL(name,namelen) do { \ - zend_hash_del(&PS(vars), name, namelen+1); \ if (PS(http_session_vars)) { \ zend_hash_del(Z_ARRVAL_P(PS(http_session_vars)), name, namelen+1); \ } \ @@ -210,7 +209,7 @@ #define PS_ENCODE_LOOP(code) \ { \ - HashTable *_ht = (PS(http_session_vars) ? Z_ARRVAL_P(PS(http_session_vars)) : &PS(vars)); \ + HashTable *_ht = Z_ARRVAL_P(PS(http_session_vars)); \ \ for (zend_hash_internal_pointer_reset(_ht); \ zend_hash_get_current_key_ex(_ht, &key, &key_length, &num_key, 0, NULL) == HASH_KEY_IS_STRING; \ Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.324 php4/ext/session/session.c:1.325 --- php4/ext/session/session.c:1.324Wed Oct 2 17:51:32 2002 +++ php4/ext/session/session.c Wed Oct 2 23:23:02 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: session.c,v 1.324 2002/10/02 21:51:32 sas Exp $ */ +/* $Id: session.c,v 1.325 2002/10/03 03:23:02 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -121,6 +121,8 @@ /* {{{ PHP_INI */ PHP_INI_BEGIN() + STD_PHP_INI_BOOLEAN("session.bug_compat_42","1", PHP_INI_ALL, +OnUpdateBool, bug_compat, php_ps_globals,ps_globals) + STD_PHP_INI_BOOLEAN("session.bug_compat_warn", "1", PHP_INI_ALL, +OnUpdateBool, bug_compat_warn,php_ps_globals,ps_globals) STD_PHP_INI_ENTRY("session.save_path", "/tmp", PHP_INI_ALL, OnUpdateString, save_path, php_ps_globals,ps_globals) STD_PHP_INI_ENTRY("session.name", "PHPSESSID", PHP_INI_ALL, OnUpdateString, session_name, php_ps_globals,ps_globals) PHP_INI_ENTRY("session.save_handler",
[PHP-CVS] cvs: php4 /ext/zlib zlib.c /main output.c php_output.h
yohgaki Wed Oct 2 23:58:12 2002 EDT Modified files: /php4/ext/zlib zlib.c /php4/main output.c php_output.h Log: Move wrong output buffer usage check to ob_gzhandler init. Export some output buffer functions. Index: php4/ext/zlib/zlib.c diff -u php4/ext/zlib/zlib.c:1.151 php4/ext/zlib/zlib.c:1.152 --- php4/ext/zlib/zlib.c:1.151 Wed Oct 2 11:02:16 2002 +++ php4/ext/zlib/zlib.cWed Oct 2 23:58:12 2002 @@ -18,7 +18,7 @@ | Jade Nicoletti <[EMAIL PROTECTED]> | +--+ */ -/* $Id: zlib.c,v 1.151 2002/10/02 15:02:16 helly Exp $ */ +/* $Id: zlib.c,v 1.152 2002/10/03 03:58:12 yohgaki Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -903,6 +903,24 @@ if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &zv_string, &zv_mode)==FAILURE) { ZEND_WRONG_PARAM_COUNT(); + } + + /* check for wrong usages */ + if (OG(ob_nesting_level>1)) { + if (php_ob_handler_used("ob_gzhandler" TSRMLS_CC)) { + php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, +"output handler 'ob_gzhandler' cannot be used twice"); + RETURN_FALSE; + } + if (php_ob_handler_used("mb_output_handler" TSRMLS_CC)) { + php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, +"output handler 'ob_gzhandler' cannot be used after 'mb_output_handler'"); + RETURN_FALSE; + } + if (php_ob_handler_used("URL-Rewriter" TSRMLS_CC)) { + php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, +"output handler 'ob_gzhandler' cannot be used after 'URL-Rewriter'"); + RETURN_FALSE; + } + if (php_ob_init_conflict("ob_gzhandler", "zlib output compression" +TSRMLS_CC)) + RETURN_FALSE; } if (ZLIBG(ob_gzhandler_status)==-1 Index: php4/main/output.c diff -u php4/main/output.c:1.130 php4/main/output.c:1.131 --- php4/main/output.c:1.130Wed Oct 2 22:55:19 2002 +++ php4/main/output.c Wed Oct 2 23:58:12 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: output.c,v 1.130 2002/10/03 02:55:19 yohgaki Exp $ */ +/* $Id: output.c,v 1.131 2002/10/03 03:58:12 yohgaki Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -370,7 +370,7 @@ /* {{{ php_ob_init_conflict * Returns 1 if handler_set is already used and generates error message */ -static int php_ob_init_conflict(char *handler_new, char *handler_set TSRMLS_DC) +PHPAPI int php_ob_init_conflict(char *handler_new, char *handler_set TSRMLS_DC) { if (php_ob_handler_used(handler_set TSRMLS_CC)) { @@ -387,26 +387,6 @@ { int handler_gz, handler_mb, handler_ic; - 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 (OG(ob_nesting_level)>0) { if (OG(ob_nesting_level)==1) { /* initialize stack */ zend_stack_init(&OG(ob_buffers)); @@ -635,7 +615,7 @@ /* {{{ php_ob_get_buffer * Return the current output buffer */ -static int php_ob_get_buffer(zval *p TSRMLS_DC) +PHPAPI int php_ob_get_buffer(zval *p TSRMLS_DC) { if (OG(ob_nesting_level)==0) { return FAILURE; @@ -647,7 +627,7 @@ /* {{{ php_ob_get_length * Return the size of the current output buffer */ -static int php_ob_get_length(zval *p TSRMLS_DC) +PHPAPI int php_ob_get_length(zval *p TSRMLS_DC) { if (OG(ob_nesting_level) == 0) { return FAILURE; Index: php4/main/php_output.h diff -u php4/main/php_output.h:1.44 php4/main/php_output.h:1
[PHP-CVS] cvs: php4 /main output.c
yohgaki Thu Oct 3 00:17:41 2002 EDT Modified files: /php4/main output.c Log: Added missing proto and foldings. Index: php4/main/output.c diff -u php4/main/output.c:1.131 php4/main/output.c:1.132 --- php4/main/output.c:1.131Wed Oct 2 23:58:12 2002 +++ php4/main/output.c Thu Oct 3 00:17:41 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: output.c,v 1.131 2002/10/03 03:58:12 yohgaki Exp $ */ +/* $Id: output.c,v 1.132 2002/10/03 04:17:41 yohgaki Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -45,13 +45,15 @@ php_output_globals output_globals; #endif +/* {{{ php_default_output_func */ static inline int php_default_output_func(const char *str, uint str_len TSRMLS_DC) { fwrite(str, 1, str_len, stderr); return str_len; } +/* }}} */ - +/* {{{ php_output_init_globals */ static void php_output_init_globals(php_output_globals *output_globals_p TSRMLS_DC) { OG(php_body_write) = php_default_output_func; @@ -60,9 +62,11 @@ OG(output_start_filename) = NULL; OG(output_start_lineno) = 0; } +/* }}} */ -/* Start output layer */ +/* {{{ php_output_startup + Start output layer */ PHPAPI void php_output_startup(void) { #ifdef ZTS @@ -71,8 +75,11 @@ php_output_init_globals(&output_globals TSRMLS_CC); #endif } +/* }}} */ +/* {{{ php_output_activate + Initilize output global for activation */ PHPAPI void php_output_activate(TSRMLS_D) { OG(php_body_write) = php_ub_body_write; @@ -83,27 +90,37 @@ OG(output_start_filename) = NULL; OG(output_start_lineno) = 0; } +/* }}} */ +/* {{{ php_output_set_status + Toggle output status */ PHPAPI void php_output_set_status(zend_bool status TSRMLS_DC) { OG(disable_output) = !status; } +/* }}} */ - +/* {{{ php_output_register_constants */ void php_output_register_constants(TSRMLS_D) { REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_START", PHP_OUTPUT_HANDLER_START, CONST_CS | CONST_PERSISTENT); REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_CONT", PHP_OUTPUT_HANDLER_CONT, CONST_CS | CONST_PERSISTENT); REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_END", PHP_OUTPUT_HANDLER_END, CONST_CS | CONST_PERSISTENT); } +/* }}} */ +/* {{{ php_body_wirte + * Write body part */ PHPAPI int php_body_write(const char *str, uint str_length TSRMLS_DC) { return OG(php_body_write)(str, str_length TSRMLS_CC); } +/* }}} */ +/* {{{ php_header_wirte + * Write HTTP header */ PHPAPI int php_header_write(const char *str, uint str_length TSRMLS_DC) { if (OG(disable_output)) { @@ -112,6 +129,7 @@ return OG(php_header_write)(str, str_length TSRMLS_CC); } } +/* }}} */ /* {{{ php_start_ob_buffer * Start output buffering */ @@ -888,6 +906,7 @@ } /* }}} */ +/* {{{ int php_ob_buffer_status(php_ob_buffer *ob_buffer, zval *result) */ static int php_ob_buffer_status(php_ob_buffer *ob_buffer, zval *result) { zval *elem; @@ -916,6 +935,7 @@ return SUCCESS; } +/* }}} */ /* {{{ proto false|array ob_get_status([bool full_status]) @@ -986,17 +1006,27 @@ } /* }}} */ + +/* {{{ char *php_get_output_start_filename(TSRMLS_D) + Return filename start output something */ PHPAPI char *php_get_output_start_filename(TSRMLS_D) { return OG(output_start_filename); } +/* }}} */ +/* {{{ char *php_get_output_start_lineno(TSRMLS_D) + Return line number start output something */ PHPAPI int php_get_output_start_lineno(TSRMLS_D) { return OG(output_start_lineno); } +/* }}} */ + +/* {{{ proto bool output_reset_rewrite_vars(void) + Reset(clear) URL rewriter values */ PHP_FUNCTION(output_reset_rewrite_vars) { if (php_url_scanner_reset_vars(TSRMLS_C) == SUCCESS) { @@ -1005,7 +1035,11 @@ RETURN_FALSE; } } +/* }}} */ + +/* {{{ proto bool output_add_rewrite_var(string name, string value) + Add URL rewriter values */ PHP_FUNCTION(output_add_rewrite_var) { char *name, *value; @@ -1021,6 +1055,7 @@ RETURN_FALSE; } } +/* }}} */ /* * Local variables: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/session session.c
sas Thu Oct 3 00:53:06 2002 EDT Modified files: /php4/ext/session session.c Log: Align behaviour with 4.2 with regard to register_globals=1 session_register("c"); unset($c); $c = time(); If a user unsets a global session variable, it is not a reference to a $_SESSION slot anymore. During serialization, PHP 4.2 will not find the respective entry in $_SESSION and fall back to the global sym table. Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.325 php4/ext/session/session.c:1.326 --- php4/ext/session/session.c:1.325Wed Oct 2 23:23:02 2002 +++ php4/ext/session/session.c Thu Oct 3 00:53:05 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: session.c,v 1.325 2002/10/03 03:23:02 sas Exp $ */ +/* $Id: session.c,v 1.326 2002/10/03 04:53:05 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -317,12 +317,32 @@ int php_get_session_var(char *name, size_t namelen, zval ***state_var TSRMLS_DC) { + int ret = FAILURE; + IF_SESSION_VARS() { - return zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, + ret = zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen+1, (void **) state_var); + + /* +* If register_globals is enabled, and +* if there is an entry for the slot in $_SESSION, and +* if that entry is still set to NULL, and +* if the global var exists, then +* we prefer the same key in the global sym table +*/ + + if (PG(register_globals) && ret == SUCCESS + && Z_TYPE_PP(*state_var) == IS_NULL) { + zval **tmp; + + if (zend_hash_find(&EG(symbol_table), name, namelen + 1, + (void **) &tmp) == SUCCESS) { + *state_var = tmp; + } + } } - return FAILURE; + return ret; } #define PS_BIN_NR_OF_BITS 8 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard string.c
yohgaki Thu Oct 3 00:54:01 2002 EDT Modified files: /php4/ext/standard string.c Log: Save memory Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.304 php4/ext/standard/string.c:1.305 --- php4/ext/standard/string.c:1.304Wed Oct 2 14:58:09 2002 +++ php4/ext/standard/string.c Thu Oct 3 00:54:01 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.304 2002/10/02 18:58:09 andrey Exp $ */ +/* $Id: string.c,v 1.305 2002/10/03 04:54:01 yohgaki Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -2468,6 +2468,7 @@ if (should_free) { STR_FREE(str); } + new_str = (char *) erealloc(new_str, *new_length); return new_str; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard string.c
yohgaki Thu Oct 3 00:56:55 2002 EDT Modified files: /php4/ext/standard string.c Log: Forgot 1 byte for \0 Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.305 php4/ext/standard/string.c:1.306 --- php4/ext/standard/string.c:1.305Thu Oct 3 00:54:01 2002 +++ php4/ext/standard/string.c Thu Oct 3 00:56:54 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.305 2002/10/03 04:54:01 yohgaki Exp $ */ +/* $Id: string.c,v 1.306 2002/10/03 04:56:54 yohgaki Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -2468,7 +2468,7 @@ if (should_free) { STR_FREE(str); } - new_str = (char *) erealloc(new_str, *new_length); + new_str = (char *) erealloc(new_str, *new_length+1); return new_str; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/session/tests 007.phpt
sas Thu Oct 3 01:06:01 2002 EDT Added files: /php4/ext/session/tests 007.phpt Log: Verify PHP 4.2 compatibility: unset($c) with enabled register_globals Index: php4/ext/session/tests/007.phpt +++ php4/ext/session/tests/007.phpt --TEST-- Verify PHP 4.2 compatibility: unset($c) with enabled register_globals --SKIPIF-- --FILE-- --EXPECT-- float(3.14) array(1) { ["c"]=> &float(3.14) } float(3.14) array(1) { ["c"]=> &float(3.14) } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/session session.c
sas Thu Oct 3 01:53:45 2002 EDT Modified files: /php4/ext/session session.c Log: (track_init) Use is_ref/refcount parameters of SET_SYMBOL macros (save_current_state) Prevent a possible deadlock which occurs when the track vars are inaccessible Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.326 php4/ext/session/session.c:1.327 --- php4/ext/session/session.c:1.326Thu Oct 3 00:53:05 2002 +++ php4/ext/session/session.c Thu Oct 3 01:53:45 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: session.c,v 1.326 2002/10/03 04:53:05 sas Exp $ */ +/* $Id: session.c,v 1.327 2002/10/03 05:53:45 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -499,9 +499,9 @@ MAKE_STD_ZVAL(PS(http_session_vars)); array_init(PS(http_session_vars)); - - ZEND_SET_GLOBAL_VAR("HTTP_SESSION_VARS", PS(http_session_vars)); - ZEND_SET_GLOBAL_VAR("_SESSION", PS(http_session_vars)); + + ZEND_SET_GLOBAL_VAR_WITH_LENGTH("HTTP_SESSION_VARS", +sizeof("HTTP_SESSION_VARS"), PS(http_session_vars), 2, 1); + ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), +PS(http_session_vars), 2, 1); } static char *php_session_encode(int *newlen TSRMLS_DC) @@ -662,30 +662,27 @@ php_error(E_WARNING, "Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn."); } } - } else { - return; - } - if (PS(mod_data)) { - char *val; - int vallen; - - val = php_session_encode(&vallen TSRMLS_CC); - if (val) { - ret = PS(mod)->write(&PS(mod_data), PS(id), val, vallen TSRMLS_CC); - efree(val); - } else { - ret = PS(mod)->write(&PS(mod_data), PS(id), "", 0 TSRMLS_CC); + if (PS(mod_data)) { + char *val; + int vallen; + + val = php_session_encode(&vallen TSRMLS_CC); + if (val) { + ret = PS(mod)->write(&PS(mod_data), PS(id), val, +vallen TSRMLS_CC); + efree(val); + } else { + ret = PS(mod)->write(&PS(mod_data), PS(id), "", 0 +TSRMLS_CC); + } } + + if (ret == FAILURE) + php_error(E_WARNING, "Failed to write session data (%s). +Please " + "verify that the current setting of +session.save_path " + "is correct (%s)", + PS(mod)->name, + PS(save_path)); } - - if (ret == FAILURE) - php_error(E_WARNING, "Failed to write session data (%s). Please " - "verify that the current setting of session.save_path " - "is correct (%s)", - PS(mod)->name, - PS(save_path)); - if (PS(mod_data)) PS(mod)->close(&PS(mod_data) TSRMLS_CC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/session session.c
sas Thu Oct 3 02:29:58 2002 EDT Modified files: /php4/ext/session session.c Log: Use ZEND_SET_SYMBOL_WITH_LENGTH correctly (hopefully) It strikes me as awkward that a Zend API user needs to take care of doing the engine's reference counting. This fixes a memory overrun in a testcase. All ZEND_SET_* calls should be correct now. Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.327 php4/ext/session/session.c:1.328 --- php4/ext/session/session.c:1.327Thu Oct 3 01:53:45 2002 +++ php4/ext/session/session.c Thu Oct 3 02:29:58 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: session.c,v 1.327 2002/10/03 05:53:45 sas Exp $ */ +/* $Id: session.c,v 1.328 2002/10/03 06:29:58 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -624,7 +624,7 @@ case HASH_KEY_IS_STRING: zend_hash_find(&EG(symbol_table), str, str_len, (void **) &val); if (val) { - ZEND_SET_SYMBOL_WITH_LENGTH(ht, str, str_len, *val, 1, 0); + ZEND_SET_SYMBOL_WITH_LENGTH(ht, str, str_len, *val, +(*val)->refcount + 1 , 1); } break; case HASH_KEY_IS_LONG: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/session/tests 008.phpt
sas Thu Oct 3 02:32:45 2002 EDT Added files: /php4/ext/session/tests 008.phpt Log: Verify PHP 4.2 compatibility: global is used albeit register_globals=0 Index: php4/ext/session/tests/008.phpt +++ php4/ext/session/tests/008.phpt --TEST-- Verify PHP 4.2 compatibility: global is used albeit register_globals=0 --SKIPIF-- --FILE-- --EXPECT-- NULL array(1) { ["c"]=> float(3.14) } NULL array(1) { ["c"]=> float(3.14) } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/session/tests 007.phpt
sas Thu Oct 3 02:33:19 2002 EDT Modified files: /php4/ext/session/tests 007.phpt Log: session_destroy resets the sid, so we need to set it again here Index: php4/ext/session/tests/007.phpt diff -u php4/ext/session/tests/007.phpt:1.1 php4/ext/session/tests/007.phpt:1.2 --- php4/ext/session/tests/007.phpt:1.1 Thu Oct 3 01:06:01 2002 +++ php4/ext/session/tests/007.phpt Thu Oct 3 02:33:19 2002 @@ -17,6 +17,7 @@ session_destroy(); ### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value +session_id("abtest"); session_register("c"); unset($c); $c = 3.14; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/session/tests 008.phpt
sas Thu Oct 3 02:41:25 2002 EDT Modified files: /php4/ext/session/tests 008.phpt Log: Reenable E_WARNING and test session.bug_compat_warn in addition. Index: php4/ext/session/tests/008.phpt diff -u php4/ext/session/tests/008.phpt:1.1 php4/ext/session/tests/008.phpt:1.2 --- php4/ext/session/tests/008.phpt:1.1 Thu Oct 3 02:32:45 2002 +++ php4/ext/session/tests/008.phpt Thu Oct 3 02:41:25 2002 @@ -4,10 +4,11 @@ --FILE-- http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/session php_session.h session.c
sas Thu Oct 3 02:45:15 2002 EDT Modified files: /php4/ext/session php_session.h session.c Log: Make the interpretation of gc_probability configurable by adding session.gc_dividend. The probability of running gc on each request is then gc_probability/gc_dividend. Index: php4/ext/session/php_session.h diff -u php4/ext/session/php_session.h:1.83 php4/ext/session/php_session.h:1.84 --- php4/ext/session/php_session.h:1.83 Wed Oct 2 23:23:02 2002 +++ php4/ext/session/php_session.h Thu Oct 3 02:45:15 2002 @@ -105,6 +105,7 @@ void *mod_data; php_session_status session_status; long gc_probability; + long gc_dividend; long gc_maxlifetime; int module_number; long cache_expire; Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.328 php4/ext/session/session.c:1.329 --- php4/ext/session/session.c:1.328Thu Oct 3 02:29:58 2002 +++ php4/ext/session/session.c Thu Oct 3 02:45:15 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: session.c,v 1.328 2002/10/03 06:29:58 sas Exp $ */ +/* $Id: session.c,v 1.329 2002/10/03 06:45:15 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -128,6 +128,7 @@ PHP_INI_ENTRY("session.save_handler", "files", PHP_INI_ALL, OnUpdateSaveHandler) STD_PHP_INI_BOOLEAN("session.auto_start", "0", PHP_INI_ALL, OnUpdateBool, auto_start, php_ps_globals,ps_globals) STD_PHP_INI_ENTRY("session.gc_probability", "1", PHP_INI_ALL, OnUpdateInt,gc_probability, php_ps_globals,ps_globals) + STD_PHP_INI_ENTRY("session.gc_dividend","100", PHP_INI_ALL, +OnUpdateInt,gc_dividend,php_ps_globals,ps_globals) STD_PHP_INI_ENTRY("session.gc_maxlifetime", "1440", PHP_INI_ALL, OnUpdateInt,gc_maxlifetime, php_ps_globals,ps_globals) PHP_INI_ENTRY("session.serialize_handler", "php", PHP_INI_ALL, OnUpdateSerializer) STD_PHP_INI_ENTRY("session.cookie_lifetime","0", PHP_INI_ALL, OnUpdateInt,cookie_lifetime,php_ps_globals,ps_globals) @@ -1035,7 +1036,7 @@ if (PS(mod_data) && PS(gc_probability) > 0) { int nrdels = -1; - nrand = (int) (100.0*php_combined_lcg(TSRMLS_C)); + nrand = (int) ((float) PS(gc_dividend) * php_combined_lcg(TSRMLS_C)); if (nrand < PS(gc_probability)) { PS(mod)->gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels TSRMLS_CC); #if 0 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / php.ini-dist
sas Thu Oct 3 02:49:33 2002 EDT Modified files: /php4 php.ini-dist Log: Add new session options Index: php4/php.ini-dist diff -u php4/php.ini-dist:1.159 php4/php.ini-dist:1.160 --- php4/php.ini-dist:1.159 Wed Sep 25 19:36:27 2002 +++ php4/php.ini-dist Thu Oct 3 02:49:33 2002 @@ -793,9 +793,22 @@ ; Handler used to serialize data. php is the standard serializer of PHP. session.serialize_handler = php -; Percentual probability that the 'garbage collection' process is started +; Define the probability that the 'garbage collection' process is started ; on every session initialization. +; The probability is calculated by using gc_probability/gc_dividend, +; e.g. 1/100 means 1%. + session.gc_probability = 1 +session.gc_dividend= 100 + +; PHP 4.2 and less have an undocumented feature/bug that allows you to +; to initialize a session variable in the global scope, albeit register_globals +; is disabled. PHP 4.3 and later will warn you, if this feature is used. +; You can disable the feature and the warning seperately. At this time, +; the warning is only displayed, if bug_compat_42 is enabled. + +session.bug_compat_42 = 1 +session.bug_compat_warn = 1 ; After this number of seconds, stored data will be seen as 'garbage' and ; cleaned up by the garbage collection process. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / php.ini-recommended
sas Thu Oct 3 02:51:38 2002 EDT Modified files: /php4 php.ini-recommended Log: Add recommened entries, including disabling the session bug/feature Index: php4/php.ini-recommended diff -u php4/php.ini-recommended:1.109 php4/php.ini-recommended:1.110 --- php4/php.ini-recommended:1.109 Thu Sep 26 03:05:17 2002 +++ php4/php.ini-recommendedThu Oct 3 02:51:38 2002 @@ -810,13 +810,26 @@ ; Handler used to serialize data. php is the standard serializer of PHP. session.serialize_handler = php -; Percentual probability that the 'garbage collection' process is started +; Define the probability that the 'garbage collection' process is started ; on every session initialization. +; The probability is calculated by using gc_probability/gc_dividend, +; e.g. 1/100 means 1%. + session.gc_probability = 1 +session.gc_dividend= 1000 ; After this number of seconds, stored data will be seen as 'garbage' and ; cleaned up by the garbage collection process. session.gc_maxlifetime = 1440 + +; PHP 4.2 and less have an undocumented feature/bug that allows you to +; to initialize a session variable in the global scope, albeit register_globals +; is disabled. PHP 4.3 and later will warn you, if this feature is used. +; You can disable the feature and the warning seperately. At this time, +; the warning is only displayed, if bug_compat_42 is enabled. + +session.bug_compat_42 = 0 +session.bug_compat_warn = 1 ; Check HTTP Referer to invalidate externally stored URLs containing ids. ; HTTP_REFERER has to contain this substring for the session to be -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / php.ini-dist
sas Thu Oct 3 02:52:24 2002 EDT Modified files: /php4 php.ini-dist Log: move gc_maxlifetime one up Index: php4/php.ini-dist diff -u php4/php.ini-dist:1.160 php4/php.ini-dist:1.161 --- php4/php.ini-dist:1.160 Thu Oct 3 02:49:33 2002 +++ php4/php.ini-dist Thu Oct 3 02:52:23 2002 @@ -801,6 +801,13 @@ session.gc_probability = 1 session.gc_dividend= 100 +; After this number of seconds, stored data will be seen as 'garbage' and +; cleaned up by the garbage collection process. +; WARNING: Your filesystem must store access times. Windows FAT does +; not. So, see session_set_save_handler() and write your own +; session handler with a different mechanism for cleaning up sessions. +session.gc_maxlifetime = 1440 + ; PHP 4.2 and less have an undocumented feature/bug that allows you to ; to initialize a session variable in the global scope, albeit register_globals ; is disabled. PHP 4.3 and later will warn you, if this feature is used. @@ -809,13 +816,6 @@ session.bug_compat_42 = 1 session.bug_compat_warn = 1 - -; After this number of seconds, stored data will be seen as 'garbage' and -; cleaned up by the garbage collection process. -; WARNING: Your filesystem must store access times. Windows FAT does -; not. So, see session_set_save_handler() and write your own -; session handler with a different mechanism for cleaning up sessions. -session.gc_maxlifetime = 1440 ; Check HTTP Referer to invalidate externally stored URLs containing ids. ; HTTP_REFERER has to contain this substring for the session to be -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/mbstring/tests 007.inc /ext/standard basic_functions.c /main output.c php_output.h
yohgaki Thu Oct 3 03:17:14 2002 EDT Modified files: /php4/ext/mbstring/tests007.inc /php4/ext/standard basic_functions.c /php4/main output.c php_output.h Log: Added ob_flush_all() that flushes bufferred contents until it actually sent/printed. @ Added ob_flush_all() that flushes all buffers. (Yasuo) Index: php4/ext/mbstring/tests/007.inc diff -u php4/ext/mbstring/tests/007.inc:1.1 php4/ext/mbstring/tests/007.inc:1.2 --- php4/ext/mbstring/tests/007.inc:1.1 Sat Mar 2 05:44:57 2002 +++ php4/ext/mbstring/tests/007.inc Thu Oct 3 03:17:12 2002 @@ -6,6 +6,8 @@ mb_http_output('EUC-JP') or print("mb_http_output() failed\n"); ob_start('mb_output_handler'); echo $euc_jp; -ob_end_flush(); +$output = ob_get_clean(); + +var_dump( $output ); ?> Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.517 php4/ext/standard/basic_functions.c:1.518 --- php4/ext/standard/basic_functions.c:1.517 Wed Oct 2 21:36:43 2002 +++ php4/ext/standard/basic_functions.c Thu Oct 3 03:17:12 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.517 2002/10/03 01:36:43 yohgaki Exp $ */ +/* $Id: basic_functions.c,v 1.518 2002/10/03 07:17:12 yohgaki Exp $ */ #include "php.h" #include "php_streams.h" @@ -747,6 +747,7 @@ /* functions from output.c */ PHP_FE(ob_start, NULL) PHP_FE(ob_flush, NULL) + PHP_FE(ob_flush_all, + NULL) PHP_FE(ob_clean, NULL) PHP_FE(ob_end_flush, NULL) PHP_FE(ob_end_clean, NULL) Index: php4/main/output.c diff -u php4/main/output.c:1.132 php4/main/output.c:1.133 --- php4/main/output.c:1.132Thu Oct 3 00:17:41 2002 +++ php4/main/output.c Thu Oct 3 03:17:13 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: output.c,v 1.132 2002/10/03 04:17:41 yohgaki Exp $ */ +/* $Id: output.c,v 1.133 2002/10/03 07:17:13 yohgaki Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -739,7 +739,7 @@ /* }}} */ /* {{{ proto bool ob_flush(void) - Flush (send) contents of the output buffers */ + Flush (send) contents of the output buffer. The last buffer content is sent to +next buffer */ PHP_FUNCTION(ob_flush) { if (ZEND_NUM_ARGS() != 0) @@ -749,8 +749,31 @@ php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to flush buffer. No buffer to flush."); RETURN_FALSE; } - + php_end_ob_buffer(1, 1 TSRMLS_CC); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ob_flush_all(void) + Flush (send) contents of output buffers. All buffered contents will be +written/sent */ +PHP_FUNCTION(ob_flush_all) +{ + int orig; + + if (ZEND_NUM_ARGS() != 0) + WRONG_PARAM_COUNT; + + if (!OG(ob_nesting_level)) { + php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to +flush buffer. No buffer to flush."); + RETURN_FALSE; + } + + orig = OG(implicit_flush); /* save current implicit flush state */ + php_start_implicit_flush(TSRMLS_C); + php_end_ob_buffer(1, 1 TSRMLS_CC); + OG(implicit_flush) = orig; + RETURN_TRUE; } /* }}} */ Index: php4/main/php_output.h diff -u php4/main/php_output.h:1.45 php4/main/php_output.h:1.46 --- php4/main/php_output.h:1.45 Wed Oct 2 23:58:12 2002 +++ php4/main/php_output.h Thu Oct 3 03:17:14 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_output.h,v 1.45 2002/10/03 03:58:12 yohgaki Exp $ */ +/* $Id: php_output.h,v 1.46 2002/10/03 07:17:14 yohgaki Exp $ */ #ifndef PHP_OUTPUT_H #define PHP_OUTPUT_H @@ -47,6 +47,7 @@ PHP_FUNCTION(ob_start); PHP_FUNCTION(ob_flush); +PHP_FUNCTION(ob_flush_all); PHP_FUNCTION(ob_clean); PHP_FUNCTION(ob_end_flush); PHP_FUNCTION(ob_end_clean); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/mbstring/tests 007.phpt
yohgaki Thu Oct 3 03:19:28 2002 EDT Modified files: /php4/ext/mbstring/tests007.phpt Log: Update test Index: php4/ext/mbstring/tests/007.phpt diff -u php4/ext/mbstring/tests/007.phpt:1.2 php4/ext/mbstring/tests/007.phpt:1.3 --- php4/ext/mbstring/tests/007.phpt:1.2Sun Mar 10 08:17:59 2002 +++ php4/ext/mbstring/tests/007.phptThu Oct 3 03:19:27 2002 @@ -7,5 +7,4 @@ --FILE-- --EXPECT-- -¥Æ¥¹¥ÈÍÑÆüËܸìʸ»úÎ󡣤³¤Î¥â¥¸¥å¡¼¥ë¤ÏPHP¤Ë¥Þ¥ë¥Á¥Ð¥¤¥È´Ø¿ô¤òÄ󶡤·¤Þ¤¹¡£ - +string(73) "¥Æ¥¹¥ÈÍÑÆüËܸìʸ»úÎ󡣤³¤Î¥â¥¸¥å¡¼¥ë¤ÏPHP¤Ë¥Þ¥ë¥Á¥Ð¥¤¥È´Ø¿ô¤òÄ󶡤·¤Þ¤¹¡£" -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/session session.c
andiThu Oct 3 03:23:52 2002 EDT Modified files: /php4/ext/session session.c Log: - Fix ZTS build Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.329 php4/ext/session/session.c:1.330 --- php4/ext/session/session.c:1.329Thu Oct 3 02:45:15 2002 +++ php4/ext/session/session.c Thu Oct 3 03:23:50 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: session.c,v 1.329 2002/10/03 06:45:15 sas Exp $ */ +/* $Id: session.c,v 1.330 2002/10/03 07:23:50 andi Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -654,7 +654,7 @@ if (Z_TYPE_PP(val) == IS_NULL) { do_warn = 1; - migrate_global(ht, &pos); + migrate_global(ht, &pos TSRMLS_CC); } zend_hash_move_forward_ex(ht, &pos); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php