[PHP-CVS-DAILY] cvs: php4 / ChangeLog
changelog Mon Feb 17 20:33:50 2003 EDT Modified files: /php4 ChangeLog Log: ChangeLog update Index: php4/ChangeLog diff -u php4/ChangeLog:1.1269 php4/ChangeLog:1.1270 --- php4/ChangeLog:1.1269 Sun Feb 16 20:31:33 2003 +++ php4/ChangeLog Mon Feb 17 20:33:50 2003 @@ -1,3 +1,163 @@ +2003-02-17 Georg Richter [EMAIL PROTECTED] + +* ext/mysqli/tests/050.phpt + ext/mysqli/tests/051.phpt + ext/mysqli/tests/052.phpt + ext/mysqli/tests/053.phpt + ext/mysqli/tests/054.phpt + ext/mysqli/tests/055.phpt: + additional tests for non freed objects + +2003-02-17 Jani Taskinen [EMAIL PROTECTED] + +* ext/snmp/config.m4: + MFB: Sanity check. + +* (PHP_4_3) + ext/snmp/config.m4: + Sanity check to prevent errors in other extensions tests. + +* NEWS: + Update + +2003-02-17 Georg Richter [EMAIL PROTECTED] + +* ext/mysqli/tests/049.phpt: + test for mysql_fetch_row (oo-style) + +2003-02-17 Zeev Suraski [EMAIL PROTECTED] + +* ext/rpc/com/com.c + ext/rpc/com/conversion.c + ext/rpc/com/dispatch.c + ext/rpc/com/variant.c + ext/snmp/winsnmp.c + ext/standard/file.c + ext/standard/flock_compat.c + ext/standard/ftp_fopen_wrapper.c + ext/standard/http_fopen_wrapper.c + ext/standard/pack.c + ext/standard/rand.c + ext/w32api/w32api.c + ext/zlib/zlib.c + main/fopen_wrappers.c + main/main.c + main/network.c + main/php.h + main/php_open_temporary_file.c + sapi/apache/php_apache_http.h + sapi/cgi/cgi_main.c + sapi/isapi/php4isapi.c: + Win32 build improvements + +2003-02-17 Wez Furlong [EMAIL PROTECTED] + +* sapi/isapi/php4isapi.c: + Fix build under win32 + +2003-02-17 Georg Richter [EMAIL PROTECTED] + +* ext/mysqli/mysqli_fe.c: + added close method/alias for result object (for compatibility with + statement and + link objects) + +* ext/mysqli/tests/048.phpt: + test for OO-Implementation (bind_result) + +2003-02-17 Shane Caraveo [EMAIL PROTECTED] + +* ext/standard/proc_open.c: + you know it's time to get away from the keyboard when you do this. + + fix my last fix + +2003-02-17 Derick Rethans [EMAIL PROTECTED] + +* ext/standard/proc_open.c: + - Style polizei + +2003-02-17 Jani Taskinen [EMAIL PROTECTED] + +* ext/standard/basic_functions.c + ext/standard/datetime.c + ext/standard/datetime.h + ext/standard/php_standard.h + ext/standard/php_sunfuncs.h + ext/standard/sunfuncs.c + ext/standard/sunfuncs.h + win32/php4dllts.dsp: + - Cleaned this mess a bit: +. Centralized the functions sunrise/sunset to php_sunrise_sunset + to lessen duplicate code. +. Made wrapper function php_do_date_sunrise_sunset() to lessen + duplicate code. +. Coding style fixes. +. renamed sunfuncs.h - php_sunfuncs.h + +* ext/standard/tests/time/idate.phpt: + - These results were obviously got with TZ=GMT + +* ext/standard/tests/general_functions/sunfuncts.phpt: + Assuming the results were created in system with Asia/Jerusalem as TZ + +2003-02-17 Shane Caraveo [EMAIL PROTECTED] + +* ext/standard/proc_open.c: + fix it the right way + +2003-02-17 Jani Taskinen [EMAIL PROTECTED] + +* ext/standard/tests/general_functions/sunfuncts.phpt: + override precision ini setting + +2003-02-17 Shane Caraveo [EMAIL PROTECTED] + +* sapi/cgi/cgi_main.c: + prevent possible crash if used in combo with mod_gzip + fix command line + +* ext/standard/proc_open.c: + If you pass NULL, you do not get a NULL value, make sure it is. + +2003-02-17 Jani Taskinen [EMAIL PROTECTED] + +* ext/bcmath/libbcmath/src/bcmath.h + ext/bcmath/libbcmath/src/config.h + ext/ovrimos/ovrimos.c + ext/standard/flock_compat.c + win32/glob.c + win32/time.h + win32/winutil.c: + - Let's be consistent with these.. + +2003-02-17 Wez Furlong [EMAIL PROTECTED] + +* main/php_streams.h + main/streams/context.h + main/streams/filter_api.h + main/streams/plain_wrapper.h + main/streams/userspace.h: + Move some of the streams header into supplementary files + + +2003-02-17 Shane Caraveo [EMAIL PROTECTED] + +* run-tests2.php: + bring up to date with change in run-tests + +2003-02-17 Jani Taskinen [EMAIL PROTECTED] + +* (PHP_4_3) + configure.in + main/php_version.h: + Bump up the version. + +2003-02-17 Wez Furlong [EMAIL PROTECTED] + +* ext/standard/sunfuncs.c: + Fix compile warning + 2003-02-16 Wez Furlong [EMAIL PROTECTED] * win32/installer/setini.php: @@ -482,7 +642,7 @@ * (PHP_4_3) sapi/cgi/cgi_main.c: - Added missing $Id: ChangeLog,v 1.1269 2003/02/17 01:31:33 changelog Exp $ tag + Added missing $Id:
[PHP-CVS-DAILY] cvs: ZendEngine2 / ChangeLog
changelog Mon Feb 17 20:34:01 2003 EDT Modified files: /ZendEngine2ChangeLog Log: ChangeLog update Index: ZendEngine2/ChangeLog diff -u ZendEngine2/ChangeLog:1.175 ZendEngine2/ChangeLog:1.176 --- ZendEngine2/ChangeLog:1.175 Sun Feb 16 20:31:42 2003 +++ ZendEngine2/ChangeLog Mon Feb 17 20:34:00 2003 @@ -1,3 +1,20 @@ +2003-02-17 Zeev Suraski [EMAIL PROTECTED] + +* zend_language_parser.y: + Whitespace minor renames + +* zend_language_parser.y: + whitespace + +* zend_execute.c + zend_object_handlers.c + zend_object_handlers.h: + Improve handling of static member variables + +* zend_config.w32.h + zend_ini_parser.y: + Improve Win32 build performance + 2003-02-16 Zeev Suraski [EMAIL PROTECTED] * zend_execute.c: @@ -399,7 +416,7 @@ zend_types.h zend_variables.c zend_variables.h: - - Added some missing CVS $Id: ChangeLog,v 1.175 2003/02/17 01:31:42 changelog Exp $ tags, headers and footers. + - Added some missing CVS $Id: ChangeLog,v 1.176 2003/02/18 01:34:00 changelog +Exp $ tags, headers and footers. 2003-01-30 Ilia Alshanetsky [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/mysqli/tests 048.phpt
georg Mon Feb 17 03:54:23 2003 EDT Added files: /php4/ext/mysqli/tests 048.phpt Log: test for OO-Implementation (bind_result) Index: php4/ext/mysqli/tests/048.phpt +++ php4/ext/mysqli/tests/048.phpt --TEST-- mysqli bind_result (OO-Style) --FILE-- ?php include connect.inc; /*** test mysqli_connect 127.0.0.1 ***/ $mysql = mysqli_connect(localhost, $user, $passwd); $mysql-select_db(test); $mysql-query(DROP TABLE IF EXISTS test_fetch_null); $mysql-query(CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, col7 date, col8 time, col9 varbinary(10), col10 varchar(50), col11 char(20))); $mysql-query(INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)); $stmt = $mysql-prepare(SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null); $stmt-bind_result($c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11); $stmt-execute(); $stmt-fetch(); $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11); var_dump($test); $stmt-close(); $mysql-close(); ? --EXPECT-- array(11) { [0]= int(1) [1]= NULL [2]= NULL [3]= NULL [4]= NULL [5]= NULL [6]= NULL [7]= NULL [8]= NULL [9]= string(4) foo1 [10]= string(4) 1000 } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/mysqli mysqli_fe.c
georg Mon Feb 17 04:38:33 2003 EDT Modified files: /php4/ext/mysqlimysqli_fe.c Log: added close method/alias for result object (for compatibility with statement and link objects) Index: php4/ext/mysqli/mysqli_fe.c diff -u php4/ext/mysqli/mysqli_fe.c:1.5 php4/ext/mysqli/mysqli_fe.c:1.6 --- php4/ext/mysqli/mysqli_fe.c:1.5 Sun Feb 16 07:03:37 2003 +++ php4/ext/mysqli/mysqli_fe.c Mon Feb 17 04:38:32 2003 @@ -15,7 +15,7 @@ | Author: Georg Richter [EMAIL PROTECTED]| +--+ - $Id: mysqli_fe.c,v 1.5 2003/02/16 12:03:37 georg Exp $ + $Id: mysqli_fe.c,v 1.6 2003/02/17 09:38:32 georg Exp $ */ #ifdef HAVE_CONFIG_H @@ -182,6 +182,7 @@ * Every user visible function must have an entry in mysqli_result_functions[]. */ function_entry mysqli_result_methods[] = { + PHP_FALIAS(close,mysqli_free_result,NULL) PHP_FALIAS(data_seek,mysqli_data_seek,NULL) PHP_FALIAS(fetch_field,mysqli_fetch_field,NULL) PHP_FALIAS(fetch_fields,mysqli_fetch_fields,NULL) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/standard proc_open.c
strlen(command) should not be needed either since zend_parse_parameters returns the length anyway. --Wez. On Mon, 17 Feb 2003, Shane Caraveo wrote: shane Mon Feb 17 01:45:37 2003 EDT Modified files: /php4/ext/standardproc_open.c Log: you know it's time to get away from the keyboard when you do this. fix my last fix - if (cwd_len==0) { - cwd = NULL; - } + command_len = strlen(command); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/isapi php4isapi.c
wez Mon Feb 17 08:11:22 2003 EDT Modified files: /php4/sapi/isapiphp4isapi.c Log: Fix build under win32 Index: php4/sapi/isapi/php4isapi.c diff -u php4/sapi/isapi/php4isapi.c:1.96 php4/sapi/isapi/php4isapi.c:1.97 --- php4/sapi/isapi/php4isapi.c:1.96Sat Jan 25 22:39:50 2003 +++ php4/sapi/isapi/php4isapi.c Mon Feb 17 08:11:22 2003 @@ -18,6 +18,7 @@ */ #ifdef PHP_WIN32 +# include winsock2.h # include windows.h # include process.h #else -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc/com com.c conversion.c dispatch.c variant.c /ext/snmp winsnmp.c /ext/standard file.c flock_compat.c ftp_fopen_wrapper.c http_fopen_wrapper.c pack.c rand.c /ext/w32api w32api.c /ext/zlib zlib.c /main fopen_wrappers.c main.c network.c php.h php_open_temporary_file.c /sapi/apache php_apache_http.h /sapi/cgi cgi_main.c /sapi/isapi php4isapi.c
zeevMon Feb 17 08:29:59 2003 EDT Modified files: /php4/main fopen_wrappers.c main.c network.c php.h php_open_temporary_file.c /php4/ext/rpc/com com.c conversion.c dispatch.c variant.c /php4/ext/snmp winsnmp.c /php4/ext/standard file.c flock_compat.c ftp_fopen_wrapper.c http_fopen_wrapper.c pack.c rand.c /php4/ext/w32apiw32api.c /php4/ext/zlib zlib.c /php4/sapi/apache php_apache_http.h /php4/sapi/cgi cgi_main.c /php4/sapi/isapiphp4isapi.c Log: Win32 build improvements Index: php4/main/fopen_wrappers.c diff -u php4/main/fopen_wrappers.c:1.156 php4/main/fopen_wrappers.c:1.157 --- php4/main/fopen_wrappers.c:1.156Sat Feb 15 22:48:48 2003 +++ php4/main/fopen_wrappers.c Mon Feb 17 08:29:56 2003 @@ -16,7 +16,7 @@ | Jim Winstead [EMAIL PROTECTED] | +--+ */ -/* $Id: fopen_wrappers.c,v 1.156 2003/02/16 03:48:48 wez Exp $ */ +/* $Id: fopen_wrappers.c,v 1.157 2003/02/17 13:29:56 zeev Exp $ */ /* {{{ includes */ @@ -32,8 +32,6 @@ #include fcntl.h #ifdef PHP_WIN32 -#include windows.h -#include winsock2.h #define O_RDONLY _O_RDONLY #include win32/param.h #elif defined(NETWARE) Index: php4/main/main.c diff -u php4/main/main.c:1.525 php4/main/main.c:1.526 --- php4/main/main.c:1.525 Sat Feb 15 15:22:19 2003 +++ php4/main/main.cMon Feb 17 08:29:56 2003 @@ -18,10 +18,13 @@ +--+ */ -/* $Id: main.c,v 1.525 2003/02/15 20:22:19 sniper Exp $ */ +/* $Id: main.c,v 1.526 2003/02/17 13:29:56 zeev Exp $ */ /* {{{ includes */ + +#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS + #include stdio.h #include php.h #ifdef PHP_WIN32 Index: php4/main/network.c diff -u php4/main/network.c:1.87 php4/main/network.c:1.88 --- php4/main/network.c:1.87Sat Feb 15 22:48:48 2003 +++ php4/main/network.c Mon Feb 17 08:29:56 2003 @@ -16,7 +16,7 @@ | Streams work by Wez Furlong [EMAIL PROTECTED] | +--+ */ -/* $Id: network.c,v 1.87 2003/02/16 03:48:48 wez Exp $ */ +/* $Id: network.c,v 1.88 2003/02/17 13:29:56 zeev Exp $ */ /*#define DEBUG_MAIN_NETWORK 1*/ @@ -25,8 +25,6 @@ #include stddef.h #ifdef PHP_WIN32 -#include windows.h -#include winsock2.h #define O_RDONLY _O_RDONLY #include win32/param.h #elif defined(NETWARE) Index: php4/main/php.h diff -u php4/main/php.h:1.181 php4/main/php.h:1.182 --- php4/main/php.h:1.181 Sat Feb 15 22:48:48 2003 +++ php4/main/php.h Mon Feb 17 08:29:56 2003 @@ -17,14 +17,10 @@ +--+ */ -/* $Id: php.h,v 1.181 2003/02/16 03:48:48 wez Exp $ */ +/* $Id: php.h,v 1.182 2003/02/17 13:29:56 zeev Exp $ */ #ifndef PHP_H #define PHP_H - -#ifdef PHP_WIN32 -#include winsock2.h -#endif #ifdef HAVE_DMALLOC #include dmalloc.h Index: php4/main/php_open_temporary_file.c diff -u php4/main/php_open_temporary_file.c:1.23 php4/main/php_open_temporary_file.c:1.24 --- php4/main/php_open_temporary_file.c:1.23Sat Feb 15 22:48:48 2003 +++ php4/main/php_open_temporary_file.c Mon Feb 17 08:29:56 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_open_temporary_file.c,v 1.23 2003/02/16 03:48:48 wez Exp $ */ +/* $Id: php_open_temporary_file.c,v 1.24 2003/02/17 13:29:56 zeev Exp $ */ #include php.h @@ -26,8 +26,6 @@ #include fcntl.h #ifdef PHP_WIN32 -#include windows.h -#include winsock2.h #define O_RDONLY _O_RDONLY #include win32/param.h #include win32/winutil.h Index: php4/ext/rpc/com/com.c diff -u php4/ext/rpc/com/com.c:1.21 php4/ext/rpc/com/com.c:1.22 --- php4/ext/rpc/com/com.c:1.21 Mon Feb 10 19:54:25 2003 +++ php4/ext/rpc/com/com.c Mon Feb 17 08:29:57 2003 @@ -19,6 +19,8 @@ #define _WIN32_DCOM #define COBJMACROS +#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS + #include ../rpc.h #include ../handler.h Index: php4/ext/rpc/com/conversion.c diff -u php4/ext/rpc/com/conversion.c:1.55 php4/ext/rpc/com/conversion.c:1.56 --- php4/ext/rpc/com/conversion.c:1.55 Mon Feb 10 15:58:53 2003 +++ php4/ext/rpc/com/conversion.c Mon Feb 17 08:29:57 2003 @@ -31,6 +31,8 @@ #ifdef PHP_WIN32 +#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS + #include php.h #include ../rpc.h Index: php4/ext/rpc/com/dispatch.c diff -u php4/ext/rpc/com/dispatch.c:1.5 php4/ext/rpc/com/dispatch.c:1.6 --- php4/ext/rpc/com/dispatch.c:1.5 Tue Dec 31 11:07:23 2002 +++ php4/ext/rpc/com/dispatch.c Mon Feb 17 08:29:57 2003 @@ -16,12 +16,14 @@ +--+ */ -/* $Id: dispatch.c,v 1.5 2002/12/31 16:07:23 sebastian Exp $ */ +/* $Id: dispatch.c,v 1.6 2003/02/17
[PHP-CVS] cvs: php4 /ext/mysqli/tests 049.phpt
georg Mon Feb 17 11:19:49 2003 EDT Added files: /php4/ext/mysqli/tests 049.phpt Log: test for mysql_fetch_row (oo-style) Index: php4/ext/mysqli/tests/049.phpt +++ php4/ext/mysqli/tests/049.phpt --TEST-- mysql_fetch_row (OO-Style) --FILE-- ?php include connect.inc; /*** test mysqli_connect 127.0.0.1 ***/ $mysql = mysqli_connect(localhost, $user, $passwd); $mysql-select_db(test); $result = $mysql-query(SELECT CURRENT_USER()); $row = $result-fetch_row(); $result-close(); var_dump($row); $mysql-close(); ? --EXPECT-- array(1) { [0]= string(14) root@localhost } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) / NEWS
sniper Mon Feb 17 13:16:49 2003 EDT Modified files: (Branch: PHP_4_3) /php4 NEWS Log: MFH Index: php4/NEWS diff -u php4/NEWS:1.1247.2.92 php4/NEWS:1.1247.2.93 --- php4/NEWS:1.1247.2.92 Sat Feb 15 15:42:49 2003 +++ php4/NEWS Mon Feb 17 13:16:49 2003 @@ -1,6 +1,6 @@ PHP 4 NEWS ||| -? ? ??? 200?, Version 4.3.1 +?? ??? 2003, Version 4.3.2 - Enabled read-only GIF support in the bundled GDLIB (php_gd2.dll) on Windows. (Sebastian, Edin) - Improved dba extension (Marcus) @@ -97,6 +97,9 @@ - Fixed bug #14532 (fixed connection_status() to return 2 for timeouts). (Jani) - Fixed bug #13561 (--without-pear disabled phpize/php-config install). (Jani) +17 Feb 2003, Version 4.3.1 +- Fixed serious security vulnerability in CGI SAPI. (Shane) + 27 Dec 2002, Version 4.3.0 - If you don't specify building any other SAPI make install will install the CGI SAPI binary in {PREFIX}/bin/php. If you want to install CLI SAPI in that @@ -115,7 +118,7 @@ . ext/cybercash - Make PHP_AUTH_* variables not available in safe mode under Apache when an external basic auth mechanism is used. (Philip) -- Aliased dba_popen() to dba_open() until 4.3.1 when persistent STDIO streams +- Aliased dba_popen() to dba_open() until 4.3.2 when persistent STDIO streams are introduced. (Andrei) - Fixed a security bug in the bundled MySQL library. (Georg, Stefan) - ZLIB extension is now built-in in the Windows distribution. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/snmp config.m4
sniper Mon Feb 17 17:44:47 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/snmp config.m4 Log: Sanity check to prevent errors in other extensions tests. Index: php4/ext/snmp/config.m4 diff -u php4/ext/snmp/config.m4:1.28 php4/ext/snmp/config.m4:1.28.2.1 --- php4/ext/snmp/config.m4:1.28Thu Oct 17 02:39:55 2002 +++ php4/ext/snmp/config.m4 Mon Feb 17 17:44:47 2003 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.28 2002/10/17 06:39:55 sniper Exp $ +dnl $Id: config.m4,v 1.28.2.1 2003/02/17 22:44:47 sniper Exp $ dnl PHP_ARG_WITH(snmp,for SNMP support, @@ -25,6 +25,7 @@ PHP_ADD_INCLUDE(${SNMP_PREFIX}/include) PHP_EVAL_LIBLINE($SNMP_LIBS, SNMP_SHARED_LIBADD) AC_DEFINE(HAVE_NET_SNMP,1,[ ]) + SNMP_LIBNAME=netsnmp else AC_MSG_ERROR([Could not find the required paths. Please check your net-snmp installation.]) fi @@ -89,13 +90,22 @@ AC_CHECK_LIB(kstat, kstat_read, [ PHP_ADD_LIBRARY(kstat,,SNMP_SHARED_LIBADD) ]) PHP_ADD_INCLUDE($SNMP_INCDIR) PHP_ADD_LIBRARY_WITH_PATH(snmp, $SNMP_LIBDIR, SNMP_SHARED_LIBADD) +SNMP_LIBNAME=snmp fi AC_CHECK_FUNCS(snmp_parse_oid) + PHP_CHECK_LIBRARY($SNMP_LIBNAME, init_snmp, + [ +AC_DEFINE(HAVE_SNMP,1,[ ]) + ], [ +AC_MSG_ERROR([SNMP sanity check failed. Please check config.log for more +information.]) + ], [ +$SNMP_SHARED_LIBADD + ]) + PHP_NEW_EXTENSION(snmp, snmp.c, $ext_shared) PHP_SUBST(SNMP_SHARED_LIBADD) - AC_DEFINE(HAVE_SNMP,1,[ ]) fi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/snmp config.m4
sniper Mon Feb 17 17:45:50 2003 EDT Modified files: /php4/ext/snmp config.m4 Log: MFB: Sanity check. Index: php4/ext/snmp/config.m4 diff -u php4/ext/snmp/config.m4:1.28 php4/ext/snmp/config.m4:1.29 --- php4/ext/snmp/config.m4:1.28Thu Oct 17 02:39:55 2002 +++ php4/ext/snmp/config.m4 Mon Feb 17 17:45:50 2003 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.28 2002/10/17 06:39:55 sniper Exp $ +dnl $Id: config.m4,v 1.29 2003/02/17 22:45:50 sniper Exp $ dnl PHP_ARG_WITH(snmp,for SNMP support, @@ -25,6 +25,7 @@ PHP_ADD_INCLUDE(${SNMP_PREFIX}/include) PHP_EVAL_LIBLINE($SNMP_LIBS, SNMP_SHARED_LIBADD) AC_DEFINE(HAVE_NET_SNMP,1,[ ]) + SNMP_LIBNAME=netsnmp else AC_MSG_ERROR([Could not find the required paths. Please check your net-snmp installation.]) fi @@ -89,13 +90,22 @@ AC_CHECK_LIB(kstat, kstat_read, [ PHP_ADD_LIBRARY(kstat,,SNMP_SHARED_LIBADD) ]) PHP_ADD_INCLUDE($SNMP_INCDIR) PHP_ADD_LIBRARY_WITH_PATH(snmp, $SNMP_LIBDIR, SNMP_SHARED_LIBADD) +SNMP_LIBNAME=snmp fi AC_CHECK_FUNCS(snmp_parse_oid) + PHP_CHECK_LIBRARY($SNMP_LIBNAME, init_snmp, + [ +AC_DEFINE(HAVE_SNMP,1,[ ]) + ], [ +AC_MSG_ERROR([SNMP sanity check failed. Please check config.log for more +information.]) + ], [ +$SNMP_SHARED_LIBADD + ]) + PHP_NEW_EXTENSION(snmp, snmp.c, $ext_shared) PHP_SUBST(SNMP_SHARED_LIBADD) - AC_DEFINE(HAVE_SNMP,1,[ ]) fi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/mysqli/tests 050.phpt 051.phpt 052.phpt 053.phpt 054.phpt 055.phpt
georg Mon Feb 17 18:29:59 2003 EDT Added files: /php4/ext/mysqli/tests 050.phpt 051.phpt 052.phpt 053.phpt 054.phpt 055.phpt Log: additional tests for non freed objects Index: php4/ext/mysqli/tests/050.phpt +++ php4/ext/mysqli/tests/050.phpt --TEST-- non freed statement test --FILE-- ?php include connect.inc; / * non freed stamement / $link = mysqli_connect(localhost, $user, $passwd); $stmt = mysqli_prepare($link, SELECT CURRENT_USER()); mysqli_execute($stmt); mysqli_close($link); printf(Ok\n); ? --EXPECT-- Ok Index: php4/ext/mysqli/tests/051.phpt +++ php4/ext/mysqli/tests/051.phpt --TEST-- free statement after close --FILE-- ?php include connect.inc; / * free statement after close / $link = mysqli_connect(localhost, $user, $passwd); $stmt1 = mysqli_prepare($link, SELECT CURRENT_USER()); mysqli_execute($stmt1); mysqli_close($link); mysqli_stmt_close($stmt1); printf(Ok\n); ? --EXPECT-- Ok Index: php4/ext/mysqli/tests/052.phpt +++ php4/ext/mysqli/tests/052.phpt --TEST-- call statement after close --FILE-- ?php include connect.inc; / * statement call after close / $link = mysqli_connect(localhost, $user, $passwd); $stmt2 = mysqli_prepare($link, SELECT CURRENT_USER()); mysqli_close($link); mysqli_execute($stmt2); mysqli_stmt_close($stmt2); printf(Ok\n); ? --EXPECT-- Ok Index: php4/ext/mysqli/tests/053.phpt +++ php4/ext/mysqli/tests/053.phpt --TEST-- not freed resultset --FILE-- ?php include connect.inc; / * non freed resultset / $link = mysqli_connect(localhost, $user, $passwd); $result = mysqli_query($link, SELECT CURRENT_USER()); mysqli_close($link); printf(Ok\n); ? --EXPECT-- Ok Index: php4/ext/mysqli/tests/054.phpt +++ php4/ext/mysqli/tests/054.phpt --TEST-- free resultset after close --FILE-- ?php include connect.inc; / * free resultset after close / $link = mysqli_connect(localhost, $user, $passwd); $result1 = mysqli_query($link, SELECT CURRENT_USER()); mysqli_close($link); mysqli_free_result($result1); printf(Ok\n); ? --EXPECT-- Ok Index: php4/ext/mysqli/tests/055.phpt +++ php4/ext/mysqli/tests/055.phpt --TEST-- free nothing --FILE-- ?php include connect.inc; / * don't free anything / $link = mysqli_connect(localhost, $user, $passwd); $result2 = mysqli_query($link, SELECT CURRENT_USER()); $stmt2 = mysqli_prepare($link, SELECT CURRENT_USER()); printf(Ok\n); ? --EXPECT-- Ok -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/mysqli mysqli.c mysqli_api.c
georg Mon Feb 17 19:00:52 2003 EDT Modified files: /php4/ext/mysqlimysqli.c mysqli_api.c Log: fixed some leaks when mysql_close will be called before all stmts are freed. Index: php4/ext/mysqli/mysqli.c diff -u php4/ext/mysqli/mysqli.c:1.4 php4/ext/mysqli/mysqli.c:1.5 --- php4/ext/mysqli/mysqli.c:1.4Fri Feb 14 15:14:44 2003 +++ php4/ext/mysqli/mysqli.cMon Feb 17 19:00:51 2003 @@ -15,7 +15,7 @@ | Author: Georg Richter [EMAIL PROTECTED]| +--+ - $Id: mysqli.c,v 1.4 2003/02/14 20:14:44 iliaa Exp $ + $Id: mysqli.c,v 1.5 2003/02/18 00:00:51 georg Exp $ */ #ifdef HAVE_CONFIG_H @@ -43,9 +43,11 @@ { unsigned int i; - if (stmt-stmt stmt-stmt-mysql-host) { - mysql_stmt_close(stmt-stmt); - } + /* +* we don't need to call mysql_stmt_close here. +* in case mysqli_stmt_close wasn't called, all +* statements will be freed via mysql_close +*/ if (stmt-var_cnt) { for (i = 0; i stmt-var_cnt; i++) { @@ -79,6 +81,13 @@ if (intern-zo.ce == mysqli_link_class_entry) { MYSQL *mysql = (MYSQL *)intern-ptr; if (mysql) { + /* +* Don't free mysql if there exist +* non closed statements +*/ + if (mysql-stmts) { + mysql-free_me = 0; + } mysql_close(mysql); } } else if (intern-zo.ce == mysqli_stmt_class_entry) { /* stmt object */ @@ -92,7 +101,6 @@ mysql_free_result(res); } } - zend_objects_destroy_object(object, handle TSRMLS_CC); } /* }}} */ Index: php4/ext/mysqli/mysqli_api.c diff -u php4/ext/mysqli/mysqli_api.c:1.12 php4/ext/mysqli/mysqli_api.c:1.13 --- php4/ext/mysqli/mysqli_api.c:1.12 Sun Feb 16 12:59:30 2003 +++ php4/ext/mysqli/mysqli_api.cMon Feb 17 19:00:51 2003 @@ -15,7 +15,7 @@ | Author: Georg Richter [EMAIL PROTECTED]| +--+ - $Id: mysqli_api.c,v 1.12 2003/02/16 17:59:30 iliaa Exp $ + $Id: mysqli_api.c,v 1.13 2003/02/18 00:00:51 georg Exp $ */ #ifdef HAVE_CONFIG_H @@ -384,6 +384,15 @@ } MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, mysql_link, mysqli_link); + + /* +* Don't free initial struct if there exist +* non closed statements +*/ + if (mysql-stmts) { + mysql-free_me = 0; + } + mysql_close(mysql); MYSQLI_CLEAR_RESOURCE(mysql_link); RETURN_TRUE; @@ -1519,7 +1528,7 @@ return; } MYSQLI_FETCH_RESOURCE(stmt, STMT *, mysql_stmt, mysqli_stmt); - + mysql_stmt_close(stmt-stmt); php_clear_stmt_bind(stmt); MYSQLI_CLEAR_RESOURCE(mysql_stmt); RETURN_TRUE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/mysqli mysqli.c
georg Mon Feb 17 19:32:47 2003 EDT Modified files: /php4/ext/mysqlimysqli.c Log: removed duplicate code Index: php4/ext/mysqli/mysqli.c diff -u php4/ext/mysqli/mysqli.c:1.5 php4/ext/mysqli/mysqli.c:1.6 --- php4/ext/mysqli/mysqli.c:1.5Mon Feb 17 19:00:51 2003 +++ php4/ext/mysqli/mysqli.cMon Feb 17 19:32:47 2003 @@ -15,7 +15,7 @@ | Author: Georg Richter [EMAIL PROTECTED]| +--+ - $Id: mysqli.c,v 1.5 2003/02/18 00:00:51 georg Exp $ + $Id: mysqli.c,v 1.6 2003/02/18 00:32:47 georg Exp $ */ #ifdef HAVE_CONFIG_H @@ -81,13 +81,6 @@ if (intern-zo.ce == mysqli_link_class_entry) { MYSQL *mysql = (MYSQL *)intern-ptr; if (mysql) { - /* -* Don't free mysql if there exist -* non closed statements -*/ - if (mysql-stmts) { - mysql-free_me = 0; - } mysql_close(mysql); } } else if (intern-zo.ce == mysqli_stmt_class_entry) { /* stmt object */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/mysqli/tests 056.phpt
georg Mon Feb 17 19:42:38 2003 EDT Added files: /php4/ext/mysqli/tests 056.phpt Log: new test (class which extends mysqli. currently this test fails :( ) Index: php4/ext/mysqli/tests/056.phpt +++ php4/ext/mysqli/tests/056.phpt --TEST-- extend mysqli --FILE-- ?php include connect.inc; class foobar extends mysqli { function test () { return (I like MySQL 4.1); } } $foo = new foobar(); $foo-connect(localhost, $user, $passwd); $foo-close(); printf(%s\n, $foo-test()); ? --EXPECT-- I like MySQL 4.1 -- 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 config.m4 exec.c exec.h
iliaa Mon Feb 17 20:07:58 2003 EDT Modified files: /php4/ext/standard basic_functions.c config.m4 exec.c exec.h Log: Added nice() function, which allows changing of priority for the current process. Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.580 php4/ext/standard/basic_functions.c:1.581 --- php4/ext/standard/basic_functions.c:1.580 Mon Feb 17 01:28:06 2003 +++ php4/ext/standard/basic_functions.c Mon Feb 17 20:07:55 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.580 2003/02/17 06:28:06 sniper Exp $ */ +/* $Id: basic_functions.c,v 1.581 2003/02/18 01:07:55 iliaa Exp $ */ #include php.h #include php_streams.h @@ -422,6 +422,10 @@ PHP_FE(proc_close, NULL) PHP_FE(proc_terminate, NULL) PHP_FE(proc_get_status, NULL) +#endif + +#ifdef HAVE_NICE + PHP_FE(nice, + NULL) #endif PHP_FE(rand, NULL) Index: php4/ext/standard/config.m4 diff -u php4/ext/standard/config.m4:1.55 php4/ext/standard/config.m4:1.56 --- php4/ext/standard/config.m4:1.55Sun Feb 16 17:28:00 2003 +++ php4/ext/standard/config.m4 Mon Feb 17 20:07:57 2003 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.55 2003/02/16 22:28:00 momo Exp $ -*- sh -*- +dnl $Id: config.m4,v 1.56 2003/02/18 01:07:57 iliaa Exp $ -*- sh -*- divert(3)dnl @@ -273,6 +273,11 @@ PHP_CHECK_FUNC(res_nsend, resolv, bind, socket) PHP_CHECK_FUNC(dn_expand, resolv, bind, socket) dnl already done PHP_CHECK_FUNC(dn_skipname, resolv, bind, socket) + +dnl +dnl Check for the availability of the nice function +dnl +PHP_CHECK_FUNC(nice) PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \ cyr_convert.c datetime.c dir.c dl.c dns.c exec.c file.c filestat.c \ Index: php4/ext/standard/exec.c diff -u php4/ext/standard/exec.c:1.92 php4/ext/standard/exec.c:1.93 --- php4/ext/standard/exec.c:1.92 Sat Jan 18 15:01:40 2003 +++ php4/ext/standard/exec.cMon Feb 17 20:07:57 2003 @@ -15,7 +15,7 @@ | Author: Rasmus Lerdorf | +--+ */ -/* $Id: exec.c,v 1.92 2003/01/18 20:01:40 iliaa Exp $ */ +/* $Id: exec.c,v 1.93 2003/02/18 01:07:57 iliaa Exp $ */ #include stdio.h #include php.h @@ -45,6 +45,10 @@ #include fcntl.h #endif +#if HAVE_NICE HAVE_UNISTD_H +#include unistd.h +#endif + /* {{{ php_Exec * If type==0, only last line of output is returned (exec) * If type==1, all lines will be printed and last lined returned (system) @@ -486,6 +490,29 @@ Z_STRVAL_P(return_value)[total_readbytes] = '\0'; } /* }}} */ + +#ifdef HAVE_NICE +/* {{{ proto bool nice(int priority) + Change the priority of the current process */ +PHP_FUNCTION(nice) +{ + long pri; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, pri) == FAILURE) { + RETURN_FALSE; + } + + errno = 0; + nice(pri); + if (errno) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Only a super user may +attempt to increase the process priority.); + RETURN_FALSE; + } + + RETURN_TRUE; +} +/* }}} */ +#endif /* * Local variables: Index: php4/ext/standard/exec.h diff -u php4/ext/standard/exec.h:1.18 php4/ext/standard/exec.h:1.19 --- php4/ext/standard/exec.h:1.18 Sat Feb 15 12:18:57 2003 +++ php4/ext/standard/exec.hMon Feb 17 20:07:57 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: exec.h,v 1.18 2003/02/15 17:18:57 wez Exp $ */ +/* $Id: exec.h,v 1.19 2003/02/18 01:07:57 iliaa Exp $ */ #ifndef EXEC_H #define EXEC_H @@ -31,6 +31,7 @@ PHP_FUNCTION(proc_get_status); PHP_FUNCTION(proc_close); PHP_FUNCTION(proc_terminate); +PHP_FUNCTION(nice); PHP_MINIT_FUNCTION(proc_open); char *php_escape_shell_cmd(char *); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/standard basic_functions.c config.m4 exec.c exec.h
On Tue, Feb 18, 2003 at 01:07:58AM -, Ilia Alshanetsky wrote: iliaa Mon Feb 17 20:07:58 2003 EDT Modified files: /php4/ext/standardbasic_functions.c config.m4 exec.c exec.h Log: Added nice() function, which allows changing of priority for the current process. What do you think about naming it proc_nice() instead? -- Jon Parise ([EMAIL PROTECTED]) :: The PHP Project (http://www.php.net/) -- 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 filters.c user_filters.c /main php_streams.h /main/streams cast.c context.h filter.c filter_api.h php_stream_context.h php_stream_filter_api.h php_stream_plain_wrapper.h php_stream_userspace.h plain_wrapper.h streams.c userspace.h
wez Mon Feb 17 20:22:22 2003 EDT Added files: /php4/main/streams php_stream_context.h php_stream_filter_api.h php_stream_plain_wrapper.h php_stream_userspace.h Removed files: /php4/main/streams context.h filter_api.h plain_wrapper.h userspace.h Modified files: /php4/ext/standard file.c filters.c user_filters.c /php4/main php_streams.h /php4/main/streams cast.c filter.c streams.c Log: Implement new filter API, stage 1. This breaks user-space filters (for the time being), and those weird convert.* filters in ext/standard/filters.c The filters stack has been separated into one chain for read and one chain for write. The user-space stream_filter_append() type functions currently only operate on the read chain. They need extending to work with the write chain too. Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.304 php4/ext/standard/file.c:1.305 --- php4/ext/standard/file.c:1.304 Mon Feb 17 08:29:57 2003 +++ php4/ext/standard/file.cMon Feb 17 20:22:21 2003 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.304 2003/02/17 13:29:57 zeev Exp $ */ +/* $Id: file.c,v 1.305 2003/02/18 01:22:21 wez Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -627,6 +627,7 @@ } add_assoc_string(return_value, stream_type, (char *)stream-ops-label, 1); +#if 0 /* TODO: needs updating for new filter API */ if (stream-filterhead) { php_stream_filter *filter; @@ -639,6 +640,7 @@ add_assoc_zval(return_value, filters, newval); } +#endif add_assoc_long(return_value, unread_bytes, stream-writepos - stream-readpos); @@ -1266,9 +1268,9 @@ } if (append) { - php_stream_filter_append(stream, filter); + php_stream_filter_append(stream-readfilters, filter); } else { - php_stream_filter_prepend(stream, filter); + php_stream_filter_prepend(stream-readfilters, filter); } RETURN_TRUE; Index: php4/ext/standard/filters.c diff -u php4/ext/standard/filters.c:1.23 php4/ext/standard/filters.c:1.24 --- php4/ext/standard/filters.c:1.23Sat Jan 18 19:45:49 2003 +++ php4/ext/standard/filters.c Mon Feb 17 20:22:21 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: filters.c,v 1.23 2003/01/19 00:45:49 iliaa Exp $ */ +/* $Id: filters.c,v 1.24 2003/02/18 01:22:21 wez Exp $ */ #include php.h #include php_globals.h @@ -25,61 +25,40 @@ #include ext/standard/file.h #include ext/standard/php_string.h -/* {{{ common no-opperation methods */ -static int commonfilter_nop_flush(php_stream *stream, php_stream_filter *thisfilter, int closing TSRMLS_DC) -{ - return php_stream_filter_flush_next(stream, thisfilter, closing); -} - -static int commonfilter_nop_eof(php_stream *stream, php_stream_filter *thisfilter TSRMLS_DC) -{ - return php_stream_filter_eof_next(stream, thisfilter); -} -/* }}} */ - /* {{{ rot13 stream filter implementation */ static char rot13_from[] = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ; static char rot13_to[] = nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM; -static size_t strfilter_rot13_write(php_stream *stream, php_stream_filter *thisfilter, - const char *buf, size_t count TSRMLS_DC) -{ - char rotbuf[1024]; - size_t chunk; - size_t wrote = 0; - - while (count 0) { - chunk = count; - if (chunk sizeof(rotbuf)) - chunk = sizeof(rotbuf); - - PHP_STRLCPY(rotbuf, buf, sizeof(rotbuf), chunk); - buf += chunk; - count -= chunk; - - php_strtr(rotbuf, chunk, rot13_from, rot13_to, 52); - wrote += php_stream_filter_write_next(stream, thisfilter, rotbuf, chunk); +static php_stream_filter_status_t strfilter_rot13_filter( + php_stream *stream, + php_stream_filter *thisfilter, + php_stream_bucket_brigade *buckets_in, + php_stream_bucket_brigade *buckets_out, + size_t *bytes_consumed, + int flags + TSRMLS_DC) +{ + php_stream_bucket *bucket; + size_t consumed = 0; + + while (buckets_in-head) { + bucket = php_stream_bucket_make_writeable(buckets_in-head TSRMLS_CC); + + php_strtr(bucket-buf, bucket-buflen, rot13_from, rot13_to, 52); + consumed += bucket-buflen; + + php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); } - return wrote; -} - -static size_t strfilter_rot13_read(php_stream *stream,
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c exec.c exec.h
iliaa Mon Feb 17 20:23:52 2003 EDT Modified files: /php4/ext/standard basic_functions.c exec.c exec.h Log: By popular demand nice() is renamed to proc_nice(). A better error message for proc_nice() failure. Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.581 php4/ext/standard/basic_functions.c:1.582 --- php4/ext/standard/basic_functions.c:1.581 Mon Feb 17 20:07:55 2003 +++ php4/ext/standard/basic_functions.c Mon Feb 17 20:23:51 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.581 2003/02/18 01:07:55 iliaa Exp $ */ +/* $Id: basic_functions.c,v 1.582 2003/02/18 01:23:51 iliaa Exp $ */ #include php.h #include php_streams.h @@ -425,7 +425,7 @@ #endif #ifdef HAVE_NICE - PHP_FE(nice, NULL) + PHP_FE(proc_nice, + NULL) #endif PHP_FE(rand, NULL) Index: php4/ext/standard/exec.c diff -u php4/ext/standard/exec.c:1.93 php4/ext/standard/exec.c:1.94 --- php4/ext/standard/exec.c:1.93 Mon Feb 17 20:07:57 2003 +++ php4/ext/standard/exec.cMon Feb 17 20:23:51 2003 @@ -15,7 +15,7 @@ | Author: Rasmus Lerdorf | +--+ */ -/* $Id: exec.c,v 1.93 2003/02/18 01:07:57 iliaa Exp $ */ +/* $Id: exec.c,v 1.94 2003/02/18 01:23:51 iliaa Exp $ */ #include stdio.h #include php.h @@ -492,9 +492,9 @@ /* }}} */ #ifdef HAVE_NICE -/* {{{ proto bool nice(int priority) +/* {{{ proto bool proc_nice(int priority) Change the priority of the current process */ -PHP_FUNCTION(nice) +PHP_FUNCTION(proc_nice) { long pri; @@ -505,7 +505,7 @@ errno = 0; nice(pri); if (errno) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Only a super user may attempt to increase the process priority.); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Only a super user may +attempt to increase the priority of a process.); RETURN_FALSE; } Index: php4/ext/standard/exec.h diff -u php4/ext/standard/exec.h:1.19 php4/ext/standard/exec.h:1.20 --- php4/ext/standard/exec.h:1.19 Mon Feb 17 20:07:57 2003 +++ php4/ext/standard/exec.hMon Feb 17 20:23:51 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: exec.h,v 1.19 2003/02/18 01:07:57 iliaa Exp $ */ +/* $Id: exec.h,v 1.20 2003/02/18 01:23:51 iliaa Exp $ */ #ifndef EXEC_H #define EXEC_H @@ -31,7 +31,7 @@ PHP_FUNCTION(proc_get_status); PHP_FUNCTION(proc_close); PHP_FUNCTION(proc_terminate); -PHP_FUNCTION(nice); +PHP_FUNCTION(proc_nice); PHP_MINIT_FUNCTION(proc_open); char *php_escape_shell_cmd(char *); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard/tests/filters basic.phpt
wez Mon Feb 17 20:24:41 2003 EDT Added files: /php4/ext/standard/tests/filtersbasic.phpt Log: Add basic test of read filters and read filter chain. Index: php4/ext/standard/tests/filters/basic.phpt +++ php4/ext/standard/tests/filters/basic.phpt --TEST-- basic stream filter tests --FILE-- ?php # vim600:syn=php: $text = Hello There!; $filters = array(string.rot13, string.toupper, string.tolower); function filter_test($names) { $fp = tmpfile(); fwrite($fp, $GLOBALS[text]); rewind($fp); foreach ($names as $name) { echo filter: $name\n; var_dump(stream_filter_prepend($fp, $name)); } var_dump(fgets($fp)); fclose($fp); } foreach ($filters as $filter) { filter_test(array($filter)); } filter_test(array($filters[0], $filters[1])); ? --EXPECT-- filter: string.rot13 bool(true) string(12) Uryyb Gurer! filter: string.toupper bool(true) string(12) HELLO THERE! filter: string.tolower bool(true) string(12) hello there! filter: string.rot13 bool(true) filter: string.toupper bool(true) string(12) URYYB GURER! -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main/streams filter.c streams.c
wez Mon Feb 17 20:39:26 2003 EDT Modified files: /php4/main/streams filter.c streams.c Log: TSRMLS! Index: php4/main/streams/filter.c diff -u php4/main/streams/filter.c:1.2 php4/main/streams/filter.c:1.3 --- php4/main/streams/filter.c:1.2 Mon Feb 17 20:22:21 2003 +++ php4/main/streams/filter.c Mon Feb 17 20:39:26 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: filter.c,v 1.2 2003/02/18 01:22:21 wez Exp $ */ +/* $Id: filter.c,v 1.3 2003/02/18 01:39:26 wez Exp $ */ #include php.h #include php_globals.h @@ -110,7 +110,7 @@ retval-refcount = 1; retval-own_buf = 1; - php_stream_bucket_delref(bucket); + php_stream_bucket_delref(bucket TSRMLS_CC); return retval; } Index: php4/main/streams/streams.c diff -u php4/main/streams/streams.c:1.2 php4/main/streams/streams.c:1.3 --- php4/main/streams/streams.c:1.2 Mon Feb 17 20:22:21 2003 +++ php4/main/streams/streams.c Mon Feb 17 20:39:26 2003 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: streams.c,v 1.2 2003/02/18 01:22:21 wez Exp $ */ +/* $Id: streams.c,v 1.3 2003/02/18 01:39:26 wez Exp $ */ #define _GNU_SOURCE #include php.h @@ -311,10 +311,10 @@ if (close_options PHP_STREAM_FREE_RELEASE_STREAM) { while (stream-readfilters.head) { - php_stream_filter_remove(stream-readfilters.head, 1); + php_stream_filter_remove(stream-readfilters.head, 1 +TSRMLS_CC); } while (stream-writefilters.head) { - php_stream_filter_remove(stream-writefilters.head, 1); + php_stream_filter_remove(stream-writefilters.head, 1 +TSRMLS_CC); } if (stream-wrapper stream-wrapper-wops stream-wrapper-wops-stream_closer) { @@ -388,7 +388,7 @@ bucket = php_stream_bucket_new(stream, chunk_buf, justread, 0, 0 TSRMLS_CC); /* after this call, bucket is owned by the brigade */ - php_stream_bucket_append(brig_inp, bucket); + php_stream_bucket_append(brig_inp, bucket TSRMLS_CC); flags = PSFS_FLAG_NORMAL; } else { @@ -845,7 +845,7 @@ if (buf) { bucket = php_stream_bucket_new(stream, (char *)buf, count, 0, 0 TSRMLS_CC); - php_stream_bucket_append(brig_in, bucket); + php_stream_bucket_append(brig_in, bucket TSRMLS_CC); } for (filter = stream-writefilters.head; filter; filter = filter-next) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/pcntl config.m4 pcntl.c php_pcntl.h
iliaa Mon Feb 17 20:41:06 2003 EDT Modified files: /php4/ext/pcntl config.m4 pcntl.c php_pcntl.h Log: Added pcntl_setpriority pcntl_getpriority(). These functions can be used to fetch and alter the priority of a process. Index: php4/ext/pcntl/config.m4 diff -u php4/ext/pcntl/config.m4:1.7 php4/ext/pcntl/config.m4:1.8 --- php4/ext/pcntl/config.m4:1.7Tue Mar 12 11:49:27 2002 +++ php4/ext/pcntl/config.m4Mon Feb 17 20:41:06 2003 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.7 2002/03/12 16:49:27 sas Exp $ +dnl $Id: config.m4,v 1.8 2003/02/18 01:41:06 iliaa Exp $ dnl dnl Process Control (pcntl) extentsion --EXPERIMENTAL-- @@ -13,6 +13,9 @@ AC_CHECK_FUNCS(fork, [ AC_DEFINE(HAVE_FORK,1,[ ]) ], [ AC_MSG_ERROR(pcntl: fork() not supported by this platform) ]) AC_CHECK_FUNCS(waitpid, [ AC_DEFINE(HAVE_WAITPID,1,[ ]) ], [ AC_MSG_ERROR(pcntl: fork() not supported by this platform) ]) AC_CHECK_FUNCS(sigaction, [ AC_DEFINE(HAVE_SIGACTION,1,[ ]) ], [ AC_MSG_ERROR(pcntl: sigaction() not supported by this platform) ]) - + + PHP_CHECK_FUNC(getpriority) + PHP_CHECK_FUNC(setpriority) + PHP_NEW_EXTENSION(pcntl, pcntl.c php_signal.c, $ext_shared, cli) fi Index: php4/ext/pcntl/pcntl.c diff -u php4/ext/pcntl/pcntl.c:1.31 php4/ext/pcntl/pcntl.c:1.32 --- php4/ext/pcntl/pcntl.c:1.31 Tue Dec 31 11:07:11 2002 +++ php4/ext/pcntl/pcntl.c Mon Feb 17 20:41:06 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: pcntl.c,v 1.31 2002/12/31 16:07:11 sebastian Exp $ */ +/* $Id: pcntl.c,v 1.32 2003/02/18 01:41:06 iliaa Exp $ */ #define PCNTL_DEBUG 0 @@ -36,6 +36,11 @@ #include ext/standard/info.h #include php_pcntl.h +#if HAVE_GETPRIORITY || HAVE_SETPRIORITY +#include sys/time.h +#include sys/resource.h +#endif + ZEND_DECLARE_MODULE_GLOBALS(pcntl) function_entry pcntl_functions[] = { @@ -50,6 +55,8 @@ PHP_FE(pcntl_wstopsig, NULL) PHP_FE(pcntl_exec, NULL) PHP_FE(pcntl_alarm, NULL) + PHP_FE(pcntl_getpriority, NULL) + PHP_FE(pcntl_setpriority, NULL) {NULL, NULL, NULL} }; @@ -132,6 +139,12 @@ #endif REGISTER_LONG_CONSTANT(SIGSYS, (long) SIGSYS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(SIGBABY, (long) SIGSYS, CONST_CS | CONST_PERSISTENT); + +#if HAVE_GETPRIORITY || HAVE_SETPRIORITY + REGISTER_LONG_CONSTANT(PRIO_PGRP, PRIO_PGRP, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(PRIO_USER, PRIO_USER, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(PRIO_PROCESS, PRIO_PROCESS, CONST_CS | +CONST_PERSISTENT); +#endif } static void php_pcntl_init_globals(zend_pcntl_globals *pcntl_globals) @@ -493,6 +506,83 @@ RETURN_TRUE; } /* }}} */ + +#ifdef HAVE_GETPRIORITY +/* {{{ proto int pcntl_getpriority(int pid, [int process_identifier]]) + Get the priority of any process */ +PHP_FUNCTION(pcntl_getpriority) +{ + long who = PRIO_PROCESS; + long pid = getpid(); + int pri; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |ll, pid, who) == +FAILURE) { + RETURN_FALSE; + } + + /* needs to be cleared, since any returned value is valid */ + errno = 0; + + pri = getpriority(who, pid); + + if (errno) { + switch (errno) { + case ESRCH: + php_error_docref(NULL TSRMLS_CC, E_WARNING, %l: No +process was located using the given parameters., errno); + break; + case EINVAL: + php_error_docref(NULL TSRMLS_CC, E_WARNING, %l: +Invalid identifier flag., errno); + break; + default: + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown +error %l has occured., errno); + break; + } + RETURN_FALSE; + } + + RETURN_LONG(pri); +} +/* }}} */ +#endif + +#ifdef HAVE_SETPRIORITY +/* {{{ proto bool pcntl_setpriority(int priority, [int pid, [int process_identifier]]) + Change the priority of any process */ +PHP_FUNCTION(pcntl_setpriority) +{ + long who = PRIO_PROCESS; + long pid = getpid(); + long pri; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l|ll, pri, pid, who) +== FAILURE) { + RETURN_FALSE; + } + + if (setpriority(who, pid, pri)) { + switch (errno) { + case ESRCH: + php_error_docref(NULL TSRMLS_CC, E_WARNING, %l: No +process was located using the given parameters., errno); + break; + case EINVAL: + php_error_docref(NULL TSRMLS_CC, E_WARNING, %l:
[PHP-CVS] cvs: php4 /ext/standard file.c /main/streams php_stream_filter_api.h
pollita Mon Feb 17 21:53:24 2003 EDT Modified files: /php4/main/streams php_stream_filter_api.h /php4/ext/standard file.c Log: Fix stream_filter_(ap|pre)pend to allow attaching on the read and/or write chains. Automagically decide what to do if noone tells us. Index: php4/main/streams/php_stream_filter_api.h diff -u php4/main/streams/php_stream_filter_api.h:1.1 php4/main/streams/php_stream_filter_api.h:1.2 --- php4/main/streams/php_stream_filter_api.h:1.1 Mon Feb 17 20:22:21 2003 +++ php4/main/streams/php_stream_filter_api.h Mon Feb 17 21:53:23 2003 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: php_stream_filter_api.h,v 1.1 2003/02/18 01:22:21 wez Exp $ */ +/* $Id: php_stream_filter_api.h,v 1.2 2003/02/18 02:53:23 pollita Exp $ */ /* The filter API works on the principle of Bucket-Brigades. This is * partially inspired by the Apache 2 method of doing things, although @@ -33,6 +33,10 @@ * The first filter in the chain is invoked on the brigade and (depending on * it's return value), the next filter is invoked and so on. * */ + +#define PHP_STREAM_FILTER_READ 0x0001 +#define PHP_STREAM_FILTER_WRITE0x0002 +#define PHP_STREAM_FILTER_ALL (PHP_STREAM_FILTER_READ | PHP_STREAM_FILTER_WRITE) typedef struct _php_stream_bucket php_stream_bucket; typedef struct _php_stream_bucket_brigade php_stream_bucket_brigade; Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.305 php4/ext/standard/file.c:1.306 --- php4/ext/standard/file.c:1.305 Mon Feb 17 20:22:21 2003 +++ php4/ext/standard/file.cMon Feb 17 21:53:24 2003 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.305 2003/02/18 01:22:21 wez Exp $ */ +/* $Id: file.c,v 1.306 2003/02/18 02:53:24 pollita Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -179,6 +179,10 @@ REGISTER_LONG_CONSTANT(STREAM_NOTIFY_SEVERITY_WARN, PHP_STREAM_NOTIFY_SEVERITY_WARN, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(STREAM_NOTIFY_SEVERITY_ERR, PHP_STREAM_NOTIFY_SEVERITY_ERR, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(STREAM_FILTER_READ, +PHP_STREAM_FILTER_READ, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(STREAM_FILTER_WRITE, +PHP_STREAM_FILTER_WRITE,CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(STREAM_FILTER_ALL, +PHP_STREAM_FILTER_ALL, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(FILE_USE_INCLUDE_PATH, PHP_FILE_USE_INCLUDE_PATH, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(FILE_IGNORE_NEW_LINES, PHP_FILE_IGNORE_NEW_LINES, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(FILE_SKIP_EMPTY_LINES, PHP_FILE_SKIP_EMPTY_LINES, CONST_CS | CONST_PERSISTENT); @@ -1252,31 +1256,60 @@ zval *zstream; php_stream *stream; char *filtername, *filterparams = NULL; - int filternamelen, filterparamslen = 0; + int filternamelen, filterparamslen = 0, read_write = 0; php_stream_filter *filter; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs|s, zstream, - filtername, filternamelen, filterparams, filterparamslen) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs|ls, zstream, + filtername, filternamelen, read_write, +filterparams, filterparamslen) == FAILURE) { RETURN_FALSE; } php_stream_from_zval(stream, zstream); - - filter = php_stream_filter_create(filtername, filterparams, filterparamslen, php_stream_is_persistent(stream) TSRMLS_CC); - if (filter == NULL) { - RETURN_FALSE; + + if ((read_write PHP_STREAM_FILTER_ALL) == 0) { + /* Chain not specified. +* Examine stream-mode to determine which filters are needed +* There's no harm in attaching a filter to an unused chain, +* but why waste the memory and clock cycles? +*/ + if (strchr(stream-mode, 'r') || strchr(stream-mode, '+')) { + read_write |= PHP_STREAM_FILTER_READ; + } + if (strchr(stream-mode, 'w') || strchr(stream-mode, '+') || +strchr(stream-mode, 'a')) { + read_write |= PHP_STREAM_FILTER_WRITE; + } } - if (append) { - php_stream_filter_append(stream-readfilters, filter); - } else { - php_stream_filter_prepend(stream-readfilters, filter); + if (read_write PHP_STREAM_FILTER_READ) { + filter = php_stream_filter_create(filtername,
[PHP-CVS] cvs: php4 /ext/mysqli mysqli_api.c
iliaa Mon Feb 17 22:12:38 2003 EDT Modified files: /php4/ext/mysqlimysqli_api.c Log: Fixed compiler warning. Index: php4/ext/mysqli/mysqli_api.c diff -u php4/ext/mysqli/mysqli_api.c:1.13 php4/ext/mysqli/mysqli_api.c:1.14 --- php4/ext/mysqli/mysqli_api.c:1.13 Mon Feb 17 19:00:51 2003 +++ php4/ext/mysqli/mysqli_api.cMon Feb 17 22:12:38 2003 @@ -15,7 +15,7 @@ | Author: Georg Richter [EMAIL PROTECTED]| +--+ - $Id: mysqli_api.c,v 1.13 2003/02/18 00:00:51 georg Exp $ + $Id: mysqli_api.c,v 1.14 2003/02/18 03:12:38 iliaa Exp $ */ #ifdef HAVE_CONFIG_H @@ -535,7 +535,8 @@ } MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, mysql_link, mysqli_link); - return (mysql_enable_rpl_parse(mysql)); + mysql_enable_rpl_parse(mysql); + RETURN_TRUE; } /* }}} */ -- 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
sniper Mon Feb 17 22:22:47 2003 EDT Modified files: /php4/ext/standard config.m4 Log: nice() is part of libc, use AC_CHECK_FUNCS instead Index: php4/ext/standard/config.m4 diff -u php4/ext/standard/config.m4:1.56 php4/ext/standard/config.m4:1.57 --- php4/ext/standard/config.m4:1.56Mon Feb 17 20:07:57 2003 +++ php4/ext/standard/config.m4 Mon Feb 17 22:22:47 2003 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.56 2003/02/18 01:07:57 iliaa Exp $ -*- sh -*- +dnl $Id: config.m4,v 1.57 2003/02/18 03:22:47 sniper Exp $ -*- sh -*- divert(3)dnl @@ -259,7 +259,7 @@ dnl AC_CHECK_HEADERS(getopt.h) dnl AC_CHECK_FUNCS(getopt_long getopt_long_only) -AC_CHECK_FUNCS(glob strfmon) +AC_CHECK_FUNCS(glob strfmon nice) if test $PHP_SAPI = cgi -o $PHP_SAPI = cli -o $PHP_SAPI = embed; then AC_DEFINE(ENABLE_CHROOT_FUNC, 1, [Whether to enable chroot() function]) @@ -273,11 +273,6 @@ PHP_CHECK_FUNC(res_nsend, resolv, bind, socket) PHP_CHECK_FUNC(dn_expand, resolv, bind, socket) dnl already done PHP_CHECK_FUNC(dn_skipname, resolv, bind, socket) - -dnl -dnl Check for the availability of the nice function -dnl -PHP_CHECK_FUNC(nice) PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \ cyr_convert.c datetime.c dir.c dl.c dns.c exec.c file.c filestat.c \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
sniper Mon Feb 17 22:27:56 2003 EDT Modified files: /php4 NEWS Log: style polizei Index: php4/NEWS diff -u php4/NEWS:1.1342 php4/NEWS:1.1343 --- php4/NEWS:1.1342Mon Feb 17 20:44:53 2003 +++ php4/NEWS Mon Feb 17 22:27:55 2003 @@ -3,11 +3,9 @@ ? ? ??? 200?, Version 5.0.0 - Added proc_nice() function, which allows changing priority of the current process. (Ilia) -- Added pcntl_getpriority() pcntl_setpriority(), which can be used to - fetch change priority of any process. (Ilia) -- new idate() function. - new date_sunrise() function. - new date_sunset() function. +- Added pcntl_getpriority() and pcntl_setpriority() functions, which can be + used to fetch and change priority of any process. (Ilia) +- Added idate(), date_sunrise() and date_sunset() functions. (Moshe Doron) - Added support for long options in CLI CGI (e.g. --version). (Marcus) - Moved extensions to PECL (http://pear.php.net/): (James, Tal) . ext/fribidi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard php_fopen_wrapper.c
pollita Tue Feb 18 01:10:17 2003 EDT Modified files: /php4/ext/standard php_fopen_wrapper.c Log: Introduce //filter target to php: wrapper to allow inline application of filters during fopen() style opperations Index: php4/ext/standard/php_fopen_wrapper.c diff -u php4/ext/standard/php_fopen_wrapper.c:1.32 php4/ext/standard/php_fopen_wrapper.c:1.33 --- php4/ext/standard/php_fopen_wrapper.c:1.32 Thu Feb 13 08:43:37 2003 +++ php4/ext/standard/php_fopen_wrapper.c Tue Feb 18 01:10:14 2003 @@ -17,7 +17,7 @@ | Hartmut Holzgraefe [EMAIL PROTECTED] | +--+ */ -/* $Id: php_fopen_wrapper.c,v 1.32 2003/02/13 13:43:37 wez Exp $ */ +/* $Id: php_fopen_wrapper.c,v 1.33 2003/02/18 06:10:14 pollita Exp $ */ #include stdio.h #include stdlib.h @@ -122,10 +122,36 @@ NULL /* set_option */ }; +static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, int +read_chain, int write_chain TSRMLS_DC) { + char *p, *token; + php_stream_filter *temp_filter; + + p = php_strtok_r(filterlist, |, token); + while (p) { + if (read_chain) { + if (temp_filter = php_stream_filter_create(p, , 0, +php_stream_is_persistent(stream) TSRMLS_CC)) { + php_stream_filter_append(stream-readfilters, +temp_filter); + } else { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to +create filter (%s)\n, p); + } + } + if (write_chain) { + if (temp_filter = php_stream_filter_create(p, , 0, +php_stream_is_persistent(stream) TSRMLS_CC)) { + php_stream_filter_append(stream-writefilters, +temp_filter); + } else { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to +create filter (%s)\n, p); + } + } + p = php_strtok_r(NULL, |, token); + } +} + + php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) { int fd = -1; php_stream * stream = NULL; + char *p, *token, *pathdup; if (!strncasecmp(path, php://, 6)) path += 6; @@ -151,6 +177,36 @@ if (stream == NULL) close(fd); } + + if (!strncasecmp(path, filter/, 7)) { + pathdup = estrndup(path + 6, strlen(path + 6)); + p = strstr(pathdup, /resource=); + if (!p) { + php_error_docref(NULL TSRMLS_CC, E_ERROR, No URL resource +specified.); + efree(pathdup); + return NULL; + } + if (!(stream = php_stream_open_wrapper(p + 10, mode, options, +opened_path))) { + efree(pathdup); + return NULL; + } + + *p = '\0'; + + p = php_strtok_r(pathdup + 1, /, token); + while (p) { + if (!strncasecmp(p, read=, 5)) { + php_stream_apply_filter_list(stream, p + 5, 1, 0 +TSRMLS_CC); + } else if (!strncasecmp(p, write=, 6)) { + php_stream_apply_filter_list(stream, p + 6, 0, 1 +TSRMLS_CC); + } else { + php_stream_apply_filter_list(stream, p, 1, 1 +TSRMLS_CC); + } + p = php_strtok_r(NULL, /, token); + } + efree(pathdup); + } + return stream; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php