Re: [PHP-CVS] cvs: php4 /ext/gd/tests conv_test.gif conv_test.jpeg conv_test.png conv_test.xpm gif2gd.phpt gif2jpg.phpt gif2png.phpt jpeg2png.phpt jpg2gd.phpt png2gd.phpt xpm2gd.phpt xpm2jpg.phpt xpm2png.phpt
Hi Ilia, when testing conversion to gd2 you do not test for gd2 existance (imagegd2() function) instead you assume that the tests fail if one uses an external gd lib (what makes the function check needless of cause). But why is that so? And why not print out an error then? Maybe we direct the users to use the internal lib then and receive less bug reports. What i really didlike with your tests is that you simply verify that there is an output by checking that there is no error. I miss a check for the output here. For example yesturday i experimented with rle gifs and was glad when i got no more errors and warnings. But then when looking at the generated images i saw they contained bullshit. Therefore i suggest you generate an md5 hash from the output and verify that, too. Why is there 'jpegxxx' and jpgxxx'? What about png2jpg, png2xpm and jpeg2xpm? Last but not least it would have liked it more if the names were different: 'conv_'format1'2'format2'.phpt'. or 'gd_'format1'2'format2'.phpt'. regards marcus At 22:04 04.12.2002, Ilia Alshanetsky wrote: iliaa Wed Dec 4 16:04:07 2002 EDT Added files: /php4/ext/gd/tests conv_test.gif conv_test.jpeg conv_test.png conv_test.xpm gif2gd.phpt gif2jpg.phpt gif2png.phpt jpeg2png.phpt jpg2gd.phpt png2gd.phpt xpm2gd.phpt xpm2jpg.phpt xpm2png.phpt Log: Added GD image conversion tests. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) / configure.in
helly Thu Dec 5 06:38:14 2002 EDT Modified files: (Branch: PHP_4_3) /php4 configure.in Log: MFH Index: php4/configure.in diff -u php4/configure.in:1.396.2.8 php4/configure.in:1.396.2.9 --- php4/configure.in:1.396.2.8 Mon Dec 2 02:03:37 2002 +++ php4/configure.in Thu Dec 5 06:38:13 2002 @@ -1,4 +1,4 @@ -dnl ## $Id: configure.in,v 1.396.2.8 2002/12/02 07:03:37 iliaa Exp $ -*- sh -*- +dnl ## $Id: configure.in,v 1.396.2.9 2002/12/05 11:38:13 helly Exp $ -*- sh -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -1311,8 +1311,10 @@ | avoid using it if possible.| ++ +X +PHP_CONFIGURE_PART(Thank you for using PHP.) +catX -Thank you for using PHP. X -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard image.c
helly Thu Dec 5 07:39:01 2002 EDT Modified files: /php4/ext/standard image.c Log: Return FALSE on error as mentioned by John Coggeshall. See Bug #20822 Index: php4/ext/standard/image.c diff -u php4/ext/standard/image.c:1.77 php4/ext/standard/image.c:1.78 --- php4/ext/standard/image.c:1.77 Tue Nov 19 16:24:47 2002 +++ php4/ext/standard/image.c Thu Dec 5 07:39:00 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: image.c,v 1.77 2002/11/19 21:24:47 iliaa Exp $ */ +/* $Id: image.c,v 1.78 2002/12/05 12:39:00 helly Exp $ */ #include php.h #include stdio.h @@ -825,6 +825,7 @@ int arg_c = ZEND_NUM_ARGS(); if ((arg_c!=1) || zend_get_parameters_ex(arg_c, p_image_type) == FAILURE) { + RETVAL_FALSE; WRONG_PARAM_COUNT; } convert_to_long_ex(p_image_type); @@ -896,6 +897,7 @@ case 1: if (zend_get_parameters_ex(1, arg1) == FAILURE) { + RETVAL_FALSE; WRONG_PARAM_COUNT; } convert_to_string_ex(arg1); @@ -903,20 +905,21 @@ case 2: if (zend_get_parameters_ex(2, arg1, info) == FAILURE) { + RETVAL_FALSE; WRONG_PARAM_COUNT; } zval_dtor(*info); if (array_init(*info) == FAILURE) { - return; + RETURN_FALSE; } convert_to_string_ex(arg1); break; default: + RETVAL_FALSE; WRONG_PARAM_COUNT; - break; } stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), rb, REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL); @@ -976,7 +979,7 @@ if (array_init(return_value) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_ERROR, Unable to initialize array); efree(result); - return; + RETURN_FALSE; } add_index_long(return_value, 0, result-width); add_index_long(return_value, 1, result-height); -- 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/standard aggregation.c
helly Thu Dec 5 07:44:21 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/standard aggregation.c Log: Fix aggregation with ZE2 in PHP4.3\n#I will not MFB it since aggregation should move to ZEndEngine Index: php4/ext/standard/aggregation.c diff -u php4/ext/standard/aggregation.c:1.11 php4/ext/standard/aggregation.c:1.11.4.1 --- php4/ext/standard/aggregation.c:1.11Fri Aug 23 21:19:27 2002 +++ php4/ext/standard/aggregation.c Thu Dec 5 07:44:21 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: aggregation.c,v 1.11 2002/08/24 01:19:27 helly Exp $ */ +/* $Id: aggregation.c,v 1.11.4.1 2002/12/05 12:44:21 helly Exp $ */ #include php.h #include basic_functions.h @@ -27,20 +27,11 @@ static void aggregation_info_dtor(aggregation_info *info) { - /* FIXME: This is here to make it compile with Engine 2 but part of this module will need rewriting */ - #ifndef ZEND_ENGINE_2 destroy_zend_class(info-new_ce); efree(info-new_ce); #else - /* FIXME: In ZE2, there seems to be an issue with refcounts or something between -* this class entry and the original; there are problems when destroying the -* function table. -* Skipping deleting here will prevent a segfault but will leak -* the class name, the static_members hash and the ce itself. -* */ - - /* destroy_zend_class(info-new_ce); */ + destroy_zend_class(info-new_ce); #endif zval_ptr_dtor(info-aggr_members); @@ -393,6 +384,9 @@ zend_hash_init(new_ce-private_properties, 10, NULL, ZVAL_PTR_DTOR, 0); zend_hash_copy(new_ce-private_properties, Z_OBJCE_P(obj)-private_properties, (copy_ctor_func_t) zval_add_ref, (void *) tmp, sizeof(zval *)); + + zend_hash_init(new_ce-protected_properties, 10, NULL, ZVAL_PTR_DTOR, +0); + zend_hash_copy(new_ce-protected_properties, +Z_OBJCE_P(obj)-protected_properties, (copy_ctor_func_t) zval_add_ref, (void *) +tmp, sizeof(zval *)); new_ce-constructor = Z_OBJCE_P(obj)-constructor; new_ce-destructor = Z_OBJCE_P(obj)-destructor; -- 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/standard image.c
helly Thu Dec 5 07:47:22 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/standard image.c Log: MFH: swc zlib\nMFH: return FALSE Index: php4/ext/standard/image.c diff -u php4/ext/standard/image.c:1.72.2.4 php4/ext/standard/image.c:1.72.2.5 --- php4/ext/standard/image.c:1.72.2.4 Mon Nov 18 11:53:04 2002 +++ php4/ext/standard/image.c Thu Dec 5 07:47:22 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: image.c,v 1.72.2.4 2002/11/18 16:53:04 helly Exp $ */ +/* $Id: image.c,v 1.72.2.5 2002/12/05 12:47:22 helly Exp $ */ #include php.h #include stdio.h @@ -80,7 +80,9 @@ REGISTER_LONG_CONSTANT(IMAGETYPE_JP2, IMAGE_FILETYPE_JP2, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMAGETYPE_JPX, IMAGE_FILETYPE_JPX, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMAGETYPE_JB2, IMAGE_FILETYPE_JB2, CONST_CS | CONST_PERSISTENT); +#if HAVE_ZLIB REGISTER_LONG_CONSTANT(IMAGETYPE_SWC, IMAGE_FILETYPE_SWC, CONST_CS | CONST_PERSISTENT); +#endif REGISTER_LONG_CONSTANT(IMAGETYPE_IFF, IMAGE_FILETYPE_IFF, CONST_CS | CONST_PERSISTENT); return SUCCESS; } @@ -823,6 +825,7 @@ int arg_c = ZEND_NUM_ARGS(); if ((arg_c!=1) || zend_get_parameters_ex(arg_c, p_image_type) == FAILURE) { + RETVAL_FALSE; WRONG_PARAM_COUNT; } convert_to_long_ex(p_image_type); @@ -894,6 +897,7 @@ case 1: if (zend_get_parameters_ex(1, arg1) == FAILURE) { + RETVAL_FALSE; WRONG_PARAM_COUNT; } convert_to_string_ex(arg1); @@ -901,20 +905,21 @@ case 2: if (zend_get_parameters_ex(2, arg1, info) == FAILURE) { + RETVAL_FALSE; WRONG_PARAM_COUNT; } zval_dtor(*info); if (array_init(*info) == FAILURE) { - return; + RETURN_FALSE; } convert_to_string_ex(arg1); break; default: + RETVAL_FALSE; WRONG_PARAM_COUNT; - break; } stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), rb, REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL); @@ -974,7 +979,7 @@ if (array_init(return_value) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_ERROR, Unable to initialize array); efree(result); - return; + RETURN_FALSE; } add_index_long(return_value, 0, result-width); add_index_long(return_value, 1, result-height); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4(PHP_4_3) /ext/standard image.c
On Thu, 5 Dec 2002, Marcus Boerger wrote: helly Thu Dec 5 07:47:22 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/standardimage.c Log: MFH: swc zlib\nMFH: return FALSE \n doesn't work on the command line :-) Derick -- - Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ - -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_2_0) /ext/standard image.c
helly Thu Dec 5 07:55:02 2002 EDT Modified files: (Branch: PHP_4_2_0) /php4/ext/standard image.c Log: MFH: return FALSE Index: php4/ext/standard/image.c diff -u php4/ext/standard/image.c:1.44.2.3 php4/ext/standard/image.c:1.44.2.4 --- php4/ext/standard/image.c:1.44.2.3 Thu Oct 24 07:16:57 2002 +++ php4/ext/standard/image.c Thu Dec 5 07:55:02 2002 @@ -16,7 +16,7 @@ | Marcus Boerger [EMAIL PROTECTED] | +--+ */ -/* $Id: image.c,v 1.44.2.3 2002/10/24 11:16:57 hyanantha Exp $ */ +/* $Id: image.c,v 1.44.2.4 2002/12/05 12:55:02 helly Exp $ */ /* * Based on Daniel Schmitt's imageinfo.c which carried the following * Copyright notice. @@ -574,6 +574,7 @@ case 1: if (zend_get_parameters_ex(1, arg1) == FAILURE) { + RETVAL_FALSE; WRONG_PARAM_COUNT; } convert_to_string_ex(arg1); @@ -581,18 +582,20 @@ case 2: if (zend_get_parameters_ex(2, arg1, info) == FAILURE) { + RETVAL_FALSE; WRONG_PARAM_COUNT; } zval_dtor(*info); if (array_init(*info) == FAILURE) { - return; + RETURN_FALSE; } convert_to_string_ex(arg1); break; default: + RETVAL_FALSE; WRONG_PARAM_COUNT; break; } @@ -667,7 +670,7 @@ if (array_init(return_value) == FAILURE) { php_error(E_ERROR, Unable to initialize array); efree(result); - return; + RETURN_FALSE; } add_index_long(return_value, 0, result-width); add_index_long(return_value, 1, result-height); @@ -682,6 +685,8 @@ add_assoc_long(return_value, channels, result-channels); } efree(result); + } else { + RETURN_FALSE; } } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd/tests conv_test.gif conv_test.jpeg conv_test.png conv_test.xpm gif2gd.phpt gif2jpg.phpt gif2png.phpt jpeg2png.phpt jpg2gd.phpt png2gd.phpt xpm2gd.phpt xpm2jpg.phpt xpm2png.phpt
My tests have a if (!GD_BUNDLED) {}, which as I understand should cause the test to be skipped in the event non-bundled GD is being used. The bundled gd will always fail and that is NOT an assumption, the external gd has bugs that were fixed in bundled gd these are known so it is pointless to make the tests work with bundled gd, we'd just get pointless bug reports about something that we do not have control over. MD5 hashes may be unreliable because float calculations tend to give slightly different results depending on a platform due to rounding issues. I'll will try to test this on a SunOS box later on and see if that is indeed the case. Perhaps a filesize check would be appropriate, something that would compare the generated image size and see if it is within the reasonable bounds (+- 10 bytes) of the expected image. Ilia On December 5, 2002 06:05 am, Marcus Börger wrote: Hi Ilia, when testing conversion to gd2 you do not test for gd2 existance (imagegd2() function) instead you assume that the tests fail if one uses an external gd lib (what makes the function check needless of cause). But why is that so? And why not print out an error then? Maybe we direct the users to use the internal lib then and receive less bug reports. What i really didlike with your tests is that you simply verify that there is an output by checking that there is no error. I miss a check for the output here. For example yesturday i experimented with rle gifs and was glad when i got no more errors and warnings. But then when looking at the generated images i saw they contained bullshit. Therefore i suggest you generate an md5 hash from the output and verify that, too. Why is there 'jpegxxx' and jpgxxx'? What about png2jpg, png2xpm and jpeg2xpm? Last but not least it would have liked it more if the names were different: 'conv_'format1'2'format2'.phpt'. or 'gd_'format1'2'format2'.phpt'. regards marcus At 22:04 04.12.2002, Ilia Alshanetsky wrote: iliaa Wed Dec 4 16:04:07 2002 EDT Added files: /php4/ext/gd/tests conv_test.gif conv_test.jpeg conv_test.png conv_test.xpm gif2gd.phpt gif2jpg.phpt gif2png.phpt jpeg2png.phpt jpg2gd.phpt png2gd.phpt xpm2gd.phpt xpm2jpg.phpt xpm2png.phpt Log: Added GD image conversion tests. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4(PHP_4_3) /ext/standard image.c
array_init() can no longer fail, because it means that ZE was unable to allocate memory at which point ZE will cease the script execution. So, if there are any existing checks for return value of array_init() or any other e* memory allocation functions, those checks can be safely removed since they will never happen. Ilia On December 5, 2002 07:47 am, Marcus Boerger wrote: helly Thu Dec 5 07:47:22 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/standardimage.c Log: MFH: swc zlib\nMFH: return FALSE Index: php4/ext/standard/image.c diff -u php4/ext/standard/image.c:1.72.2.4 php4/ext/standard/image.c:1.72.2.5 --- php4/ext/standard/image.c:1.72.2.4Mon Nov 18 11:53:04 2002 +++ php4/ext/standard/image.c Thu Dec 5 07:47:22 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: image.c,v 1.72.2.4 2002/11/18 16:53:04 helly Exp $ */ +/* $Id: image.c,v 1.72.2.5 2002/12/05 12:47:22 helly Exp $ */ #include php.h #include stdio.h @@ -80,7 +80,9 @@ REGISTER_LONG_CONSTANT(IMAGETYPE_JP2, IMAGE_FILETYPE_JP2, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMAGETYPE_JPX, IMAGE_FILETYPE_JPX, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMAGETYPE_JB2, IMAGE_FILETYPE_JB2, CONST_CS | CONST_PERSISTENT); +#if HAVE_ZLIB REGISTER_LONG_CONSTANT(IMAGETYPE_SWC, IMAGE_FILETYPE_SWC, CONST_CS | CONST_PERSISTENT); +#endif REGISTER_LONG_CONSTANT(IMAGETYPE_IFF, IMAGE_FILETYPE_IFF, CONST_CS | CONST_PERSISTENT); return SUCCESS; } @@ -823,6 +825,7 @@ int arg_c = ZEND_NUM_ARGS(); if ((arg_c!=1) || zend_get_parameters_ex(arg_c, p_image_type) == FAILURE) { + RETVAL_FALSE; WRONG_PARAM_COUNT; } convert_to_long_ex(p_image_type); @@ -894,6 +897,7 @@ case 1: if (zend_get_parameters_ex(1, arg1) == FAILURE) { + RETVAL_FALSE; WRONG_PARAM_COUNT; } convert_to_string_ex(arg1); @@ -901,20 +905,21 @@ case 2: if (zend_get_parameters_ex(2, arg1, info) == FAILURE) { + RETVAL_FALSE; WRONG_PARAM_COUNT; } zval_dtor(*info); if (array_init(*info) == FAILURE) { - return; + RETURN_FALSE; } convert_to_string_ex(arg1); break; default: + RETVAL_FALSE; WRONG_PARAM_COUNT; - break; } stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), rb, REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL); @@ -974,7 +979,7 @@ if (array_init(return_value) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_ERROR, Unable to initialize array); efree(result); - return; + RETURN_FALSE; } add_index_long(return_value, 0, result-width); add_index_long(return_value, 1, result-height); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4(PHP_4_3) /ext/standard image.c
On December 5, 2002 10:26 am, Marcus Börger wrote: At 16:23 05.12.2002, Ilia A. wrote: array_init() can no longer fail, because it means that ZE was unable to allocate memory at which point ZE will cease the script execution. So, if there are any existing checks for return value of array_init() or any other e* memory allocation functions, those checks can be safely removed since they will never happen. Yes you're right - and unfortunately there are hundreds of such cases in PHP. True, but if you are already modifying the code please remove those checks. This way we'll slowly, but surely get rid of unnecessary code ;) Ilia -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/ircg ircg.c
sas Thu Dec 5 10:35:04 2002 EDT Modified files: /php4/ext/ircg ircg.c Log: let the write buffer notify us about terminated connections Index: php4/ext/ircg/ircg.c diff -u php4/ext/ircg/ircg.c:1.155 php4/ext/ircg/ircg.c:1.156 --- php4/ext/ircg/ircg.c:1.155 Wed Dec 4 08:10:23 2002 +++ php4/ext/ircg/ircg.cThu Dec 5 10:35:04 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: ircg.c,v 1.155 2002/12/04 13:10:23 sas Exp $ */ +/* $Id: ircg.c,v 1.156 2002/12/05 15:35:04 sas Exp $ */ /* {{{ includes */ @@ -1047,11 +1047,9 @@ } /* }}} */ -static void wbuf_destruct(irc_write_buf *p) +static void wbuf_dead(irc_write_buf *p, void *data) { - php_ircg-irc_wbuf_destructs++; - memset(p, 0xaa, sizeof(*p)); - IRCG_SHARED_FREE(p); + irc_disconnect(data, Client connection terminated); } /* {{{ proto bool ircg_set_current(int connection) @@ -1097,7 +1095,12 @@ sizeof(int), NULL); #endif if (conn-file_fd == -1 conn-fd = 0) { - if (irc_write_buf_add(conn-wb, conn-fd) == 0) { +#if IRCG_API_VERSION 20021127 + irc_write_buf_add(conn-wb, conn-fd); + if (1) { +#else + if (irc_write_buf_add_ex(conn-wb, conn-fd, wbuf_dead, conn) +== 0) { +#endif php_ircg-irc_set_currents++; IRCGG(flush_data) = conn; /* We maintain a reference to conn until rshutdown */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/gd/tests conv_test.gif conv_test.jpeg conv_test.png conv_test.xpm gif2gd.phpt gif2jpg.phpt gif2png.phpt jpeg2png.phpt jpg2gd.phpt png2gd.phpt xpm2gd.phpt xpm2jpg.phpt xpm2png.phpt
On December 5, 2002 10:37 am, Marcus Börger wrote: At 16:20 05.12.2002, Ilia A. wrote: My tests have a if (!GD_BUNDLED) {}, which as I understand should cause the test to be skipped in the event non-bundled GD is being used. The bundled gd you meant non bundeled gd here will always fail and that is NOT an assumption, the external gd has bugs that were fixed in bundled gd these are known so it is pointless to make the tests work with bundled gd, we'd just get pointless bug reports about something that we do not have control over. MD5 hashes may be unreliable because float calculations tend to give slightly different results depending on a platform due to rounding issues. In most cases they should work becuase of little resolution required during internal operations (calculations). Most problematic in this manner are lossy file formats such as jpeg. For loss less file formats floating point differences in the different platforms shouldn't result in different images anyway. Maybe we must create a special test images that allows such hash comparisons. I doubt special images would work since there is still a good chance some platform will still produce slightly different results. Prior to my fixes this code would quite simply crash, so just the fact it does not, already implies that at least 1 part of the problem has been resolved. Ultimately without a person looking at the image it would be difficult to determine if the generated image is correct given that the output md5 checksums may differ. Ilia I'll will try to test this on a SunOS box later on and see if that is indeed the case. Perhaps a filesize check would be appropriate, something that would compare the generated image size and see if it is within the reasonable bounds (+- 10 bytes) of the expected image. If we cannot work with md5 hashes i think that's the way to go. Ilia On December 5, 2002 06:05 am, Marcus Börger wrote: Hi Ilia, when testing conversion to gd2 you do not test for gd2 existance (imagegd2() function) instead you assume that the tests fail if one uses an external gd lib (what makes the function check needless of cause). But why is that so? And why not print out an error then? Maybe we direct the users to use the internal lib then and receive less bug reports. What i really didlike with your tests is that you simply verify that there is an output by checking that there is no error. I miss a check for the output here. For example yesturday i experimented with rle gifs and was glad when i got no more errors and warnings. But then when looking at the generated images i saw they contained bullshit. Therefore i suggest you generate an md5 hash from the output and verify that, too. Why is there 'jpegxxx' and jpgxxx'? What about png2jpg, png2xpm and jpeg2xpm? Last but not least it would have liked it more if the names were different: 'conv_'format1'2'format2'.phpt'. or 'gd_'format1'2'format2'.phpt'. regards marcus At 22:04 04.12.2002, Ilia Alshanetsky wrote: iliaa Wed Dec 4 16:04:07 2002 EDT Added files: /php4/ext/gd/tests conv_test.gif conv_test.jpeg conv_test.png conv_test.xpm gif2gd.phpt gif2jpg.phpt gif2png.phpt jpeg2png.phpt jpg2gd.phpt png2gd.phpt xpm2gd.phpt xpm2jpg.phpt xpm2png.phpt Log: Added GD image conversion tests. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- 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/mysql/libmysql acinclude.m4
sniper Thu Dec 5 10:46:42 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/mysql/libmysqlacinclude.m4 Log: MFH Index: php4/ext/mysql/libmysql/acinclude.m4 diff -u php4/ext/mysql/libmysql/acinclude.m4:1.8 php4/ext/mysql/libmysql/acinclude.m4:1.8.4.1 --- php4/ext/mysql/libmysql/acinclude.m4:1.8Fri Aug 9 16:38:12 2002 +++ php4/ext/mysql/libmysql/acinclude.m4Thu Dec 5 10:46:41 2002 @@ -227,7 +227,8 @@ AC_DEFUN(MYSQL_TYPE_QSORT, [AC_CACHE_CHECK([return type of qsort], mysql_cv_type_qsort, [AC_TRY_COMPILE([#include stdlib.h -#ifdef __cplusplus extern C +#ifdef __cplusplus +extern C #endif void qsort(void *base, size_t nel, size_t width, int (*compar) (const void *, const void *)); @@ -237,7 +238,8 @@ if test $mysql_cv_type_qsort = void then AC_DEFINE_UNQUOTED(QSORT_TYPE_IS_VOID, 1, [ ]) -fi ]) +fi +]) #---START: Used in for client configure -- 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/standard image.c
helly Thu Dec 5 10:52:35 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/standard image.c Log: MFH: Remove unnecessary code here Index: php4/ext/standard/image.c diff -u php4/ext/standard/image.c:1.72.2.5 php4/ext/standard/image.c:1.72.2.6 --- php4/ext/standard/image.c:1.72.2.5 Thu Dec 5 07:47:22 2002 +++ php4/ext/standard/image.c Thu Dec 5 10:52:35 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: image.c,v 1.72.2.5 2002/12/05 12:47:22 helly Exp $ */ +/* $Id: image.c,v 1.72.2.6 2002/12/05 15:52:35 helly Exp $ */ #include php.h #include stdio.h @@ -910,9 +910,7 @@ } zval_dtor(*info); - if (array_init(*info) == FAILURE) { - RETURN_FALSE; - } + array_init(*info); convert_to_string_ex(arg1); break; @@ -976,11 +974,7 @@ php_stream_close(stream); if (result) { - if (array_init(return_value) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, Unable to initialize array); - efree(result); - RETURN_FALSE; - } + array_init(return_value); add_index_long(return_value, 0, result-width); add_index_long(return_value, 1, result-height); add_index_long(return_value, 2, itype); -- 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/mysql php_mysql.c
helly Thu Dec 5 15:02:22 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/mysql php_mysql.c Log: MFH Index: php4/ext/mysql/php_mysql.c diff -u php4/ext/mysql/php_mysql.c:1.174.2.2 php4/ext/mysql/php_mysql.c:1.174.2.3 --- php4/ext/mysql/php_mysql.c:1.174.2.2Wed Nov 20 18:01:02 2002 +++ php4/ext/mysql/php_mysql.c Thu Dec 5 15:02:21 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_mysql.c,v 1.174.2.2 2002/11/20 23:01:02 sniper Exp $ */ +/* $Id: php_mysql.c,v 1.174.2.3 2002/12/05 20:02:21 helly Exp $ */ /* TODO: * @@ -663,7 +663,7 @@ /* ensure that the link did not die */ #if MYSQL_VERSION_ID 32230 /* Use mysql_ping to ensure link is alive (and to reconnect if needed) */ if (mysql_ping(le-ptr)) { - php_error(E_WARNING, %s: Link to server lost, unable to reconnect, get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, +Link to server lost, unable to reconnect); zend_hash_del(EG(persistent_list), hashed_details, hashed_details_length+1); efree(hashed_details); MYSQL_DO_CONNECT_RETURN_FALSE(); @@ -682,7 +682,7 @@ #else if (mysql_connect(le-ptr, host, user, passwd)==NULL) { #endif - php_error(E_WARNING, %s: Link to server lost, unable to reconnect, get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, +Link to server lost, unable to reconnect); zend_hash_del(EG(persistent_list), hashed_details, hashed_details_length+1); efree(hashed_details); MYSQL_DO_CONNECT_RETURN_FALSE(); @@ -988,7 +988,7 @@ PHP_FUNCTION(mysql_info) { zval **mysql_link; - int id; + int id = -1; char *str; php_mysql_conn *mysql; @@ -1192,8 +1192,7 @@ mysql_result = (MYSQL_RES *) zend_list_find(mysql-active_result_id, type); if (mysql_result type==le_result) { if (!mysql_eof(mysql_result)) { - php_error(E_NOTICE, %s(): Function called without first fetching all rows from a previous unbuffered query, - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, %s(): +Function called without first fetching all rows from a previous unbuffered query); while (mysql_fetch_row(mysql_result)); } zend_list_delete(mysql-active_result_id); -- 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/standard file.c /ext/standard/tests/file bug12556.phpt test.csv
iliaa Thu Dec 5 15:05:20 2002 EDT Added files: (Branch: PHP_4_3) /php4/ext/standard/tests/file test.csv bug12556.phpt Modified files: /php4/ext/standard file.c Log: MFH Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.279.2.2 php4/ext/standard/file.c:1.279.2.3 --- php4/ext/standard/file.c:1.279.2.2 Sat Nov 30 14:13:28 2002 +++ php4/ext/standard/file.cThu Dec 5 15:05:19 2002 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.279.2.2 2002/11/30 19:13:28 iliaa Exp $ */ +/* $Id: file.c,v 1.279.2.3 2002/12/05 20:05:19 iliaa Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -2109,7 +2109,7 @@ /* first section exactly as php_fgetss */ zval **fd, **bytes, **p_delim, **p_enclosure; - int len; + int len, temp_len; char *buf; php_stream *stream; @@ -2194,7 +2194,8 @@ /* reserve workspace for building each individual field */ - temp = emalloc(len);/* unlikely but possible! */ + temp_len = len; + temp = emalloc(temp_len + 1); /* unlikely but possible! */ tptr = temp; /* Initialize return array */ @@ -2209,7 +2210,7 @@ /* 2. Read field, leaving bptr pointing at start of next field */ if (enclosure *bptr == enclosure) { bptr++; /* move on to first character in field */ - + /* 2A. handle enclosure delimited field */ while (*bptr) { if (*bptr == enclosure) { @@ -2236,6 +2237,13 @@ memset(buf, 0, len+1); if (php_stream_gets(stream, buf, len) == NULL) { + /* we've got an unterminated +enclosure, assign all the data +* from the start of the +enclosure to end of data to the last element +*/ + if (temp_len len) { + break; + } + efree(lineEnd); efree(temp); efree(buf); @@ -2243,6 +2251,8 @@ RETURN_FALSE; } + temp_len += len; + temp = erealloc(temp, temp_len+1); bptr = buf; tptr = buf + strlen(buf) -1; while (isspace((int) *tptr) (*tptr!=delimiter) (tptr bptr)) Index: php4/ext/standard/tests/file/test.csv +++ php4/ext/standard/tests/file/test.csv 6,7,8,line1 1,2,3,line2 2,4,5,line3 2,4,5,line3 2,4,5,line3 2,4,5,line3 2,4,5,line3 2,4,5,line3 2,4,5,line3 2,4,5,line3 2,4,5,line3 2,4,5,line3 2,4,5,line3 2,4,5,line3 2,4,5,line3 2,4,5,line3 2,4,5,line3 Index: php4/ext/standard/tests/file/bug12556.phpt +++ php4/ext/standard/tests/file/bug12556.phpt --TEST-- Bug #12556: fgetcvs ignores lengths when quotes not closed --POST-- --GET-- --FILE-- ?php $fp=fopen(dirname(__FILE__)./test.csv, r); while($line=fgetcsv($fp, 24)){ print(Read 24 bytes\n); } ? --EXPECT-- Read 24 bytes Read 24 bytes Read 24 bytes Read 24 bytes Read 24 bytes Read 24 bytes Read 24 bytes Read 24 bytes Read 24 bytes -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/session mod_files.c mod_mm.c session.c
helly Thu Dec 5 15:13:36 2002 EDT Modified files: /php4/ext/session mod_files.c mod_mm.c session.c Log: php_error - php_error_docref Index: php4/ext/session/mod_files.c diff -u php4/ext/session/mod_files.c:1.83 php4/ext/session/mod_files.c:1.84 --- php4/ext/session/mod_files.c:1.83 Wed Oct 2 02:05:16 2002 +++ php4/ext/session/mod_files.cThu Dec 5 15:13:35 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: mod_files.c,v 1.83 2002/10/02 06:05:16 sas Exp $ */ +/* $Id: mod_files.c,v 1.84 2002/12/05 20:13:35 helly Exp $ */ #include php.h @@ -142,7 +142,7 @@ ps_files_close(data); if (!ps_files_valid_key(key)) { - php_error(E_WARNING, The session id contains illegal characters, valid characters are only a-z, A-Z and 0-9); + php_error_docref(NULL TSRMLS_CC, E_WARNING, The session id +contains illegal characters, valid characters are only a-z, A-Z and 0-9); return; } if (!ps_files_path_create(buf, sizeof(buf), data, key)) @@ -157,11 +157,11 @@ #ifdef F_SETFD if (fcntl(data-fd, F_SETFD, 1)) { - php_error(E_WARNING, fcntl(%d, F_SETFD, 1) failed: %s (%d), data-fd, strerror(errno), errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, fcntl(%d, +F_SETFD, 1) failed: %s (%d), data-fd, strerror(errno), errno); } #endif } else { - php_error(E_WARNING, open(%s, O_RDWR) failed: %s (%d), buf, + php_error_docref(NULL TSRMLS_CC, E_WARNING, open(%s, O_RDWR) +failed: %s (%d), buf, strerror(errno), errno); } } @@ -180,7 +180,7 @@ dir = opendir(dirname); if (!dir) { - php_error(E_NOTICE, ps_files_cleanup_dir: opendir(%s) failed: %s (%d)\n, dirname, strerror(errno), errno); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, ps_files_cleanup_dir: +opendir(%s) failed: %s (%d)\n, dirname, strerror(errno), errno); return (0); } @@ -280,9 +280,9 @@ if (n != sbuf.st_size) { if (n == -1) - php_error(E_WARNING, read failed: %s (%d), strerror(errno), errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, read failed: %s +(%d), strerror(errno), errno); else - php_error(E_WARNING, read returned less bytes than requested); + php_error_docref(NULL TSRMLS_CC, E_WARNING, read returned +less bytes than requested); efree(*val); return FAILURE; } @@ -316,9 +316,9 @@ if (n != vallen) { if (n == -1) - php_error(E_WARNING, write failed: %s (%d), strerror(errno), errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, write failed: %s +(%d), strerror(errno), errno); else - php_error(E_WARNING, write wrote less bytes than requested); + php_error_docref(NULL TSRMLS_CC, E_WARNING, write wrote less +bytes than requested); return FAILURE; } Index: php4/ext/session/mod_mm.c diff -u php4/ext/session/mod_mm.c:1.39 php4/ext/session/mod_mm.c:1.40 --- php4/ext/session/mod_mm.c:1.39 Thu Jun 27 22:27:02 2002 +++ php4/ext/session/mod_mm.c Thu Dec 5 15:13:35 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: mod_mm.c,v 1.39 2002/06/28 02:27:02 sniper Exp $ */ +/* $Id: mod_mm.c,v 1.40 2002/12/05 20:13:35 helly Exp $ */ #include php.h @@ -124,7 +124,9 @@ sd = mm_malloc(data-mm, sizeof(ps_sd) + keylen); if (!sd) { - php_error(E_WARNING, mm_malloc failed, avail %d, err %s, mm_available(data-mm), mm_error()); + TSRMlS_FETCH(); + + php_error_docref(NULL TSRMLS_CC, E_WARNING, mm_malloc failed, avail +%d, err %s, mm_available(data-mm), mm_error()); return NULL; } @@ -359,7 +361,7 @@ if (!sd-data) { ps_sd_destroy(data, sd); - php_error(E_WARNING, cannot allocate new data segment); + php_error_docref(NULL TSRMLS_CC, E_WARNING, cannot +allocate new data segment); sd = NULL; } } Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.338 php4/ext/session/session.c:1.339 --- php4/ext/session/session.c:1.338Wed Nov 20 12:15:00 2002 +++ php4/ext/session/session.c Thu Dec 5 15:13:35 2002 @@ -17,7 +17,7 @@
Re: [PHP-CVS] cvs: php4 /ext/session mod_files.c mod_mm.c session.c
On Thu, 5 Dec 2002, Marcus Boerger wrote: helly Thu Dec 5 15:13:36 2002 EDT Modified files: /php4/ext/session mod_files.c mod_mm.c session.c Log: php_error - php_error_docref You made a type in here, TSRMlS (instead of TSRMLS). And can you also uppercase the first letter in the error message while you're at it? Seems like to correct time to make this consistent too. Derick -- - Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ - -- 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
helly Thu Dec 5 15:41:55 2002 EDT Modified files: /php4/ext/session session.c Log: correct code that is guarded by #if 0 Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.339 php4/ext/session/session.c:1.340 --- php4/ext/session/session.c:1.339Thu Dec 5 15:13:35 2002 +++ php4/ext/session/session.c Thu Dec 5 15:41:55 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: session.c,v 1.339 2002/12/05 20:13:35 helly Exp $ */ +/* $Id: session.c,v 1.340 2002/12/05 20:41:55 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -98,7 +98,7 @@ #if 0 if(!PS(mod)) { - php_error_docref(E_ERROR, Cannot find save handler %s, new_value); + php_error_docref(NULL TSRMLS_CC, E_ERROR, Cannot find save handler +%s, new_value); } #endif return SUCCESS; @@ -119,7 +119,7 @@ #if 0 if(!PS(serializer)) { - php_error_docref(E_ERROR, Cannot find serialization handler %s, new_value); + php_error_docref(NULL TSRMLS_CC, E_ERROR, Cannot find serialization +handler %s, new_value); } #endif return SUCCESS; -- 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/session mod_mm.c session.c
helly Thu Dec 5 15:42:06 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/session mod_mm.c session.c Log: MFH Index: php4/ext/session/mod_mm.c diff -u php4/ext/session/mod_mm.c:1.39.4.1 php4/ext/session/mod_mm.c:1.39.4.2 --- php4/ext/session/mod_mm.c:1.39.4.1 Thu Dec 5 15:14:09 2002 +++ php4/ext/session/mod_mm.c Thu Dec 5 15:42:05 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: mod_mm.c,v 1.39.4.1 2002/12/05 20:14:09 helly Exp $ */ +/* $Id: mod_mm.c,v 1.39.4.2 2002/12/05 20:42:05 helly Exp $ */ #include php.h @@ -124,7 +124,7 @@ sd = mm_malloc(data-mm, sizeof(ps_sd) + keylen); if (!sd) { - TSRMlS_FETCH(); + TSRMLS_FETCH(); php_error_docref(NULL TSRMLS_CC, E_WARNING, mm_malloc failed, avail %d, err %s, mm_available(data-mm), mm_error()); return NULL; Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.336.2.2 php4/ext/session/session.c:1.336.2.3 --- php4/ext/session/session.c:1.336.2.2Thu Dec 5 15:14:09 2002 +++ php4/ext/session/session.c Thu Dec 5 15:42:05 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: session.c,v 1.336.2.2 2002/12/05 20:14:09 helly Exp $ */ +/* $Id: session.c,v 1.336.2.3 2002/12/05 20:42:05 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -98,7 +98,7 @@ #if 0 if(!PS(mod)) { - php_error_docref(E_ERROR, Cannot find save handler %s, new_value); + php_error_docref(NULL TSRMLS_CC, E_ERROR, Cannot find save handler +%s, new_value); } #endif return SUCCESS; @@ -119,7 +119,7 @@ #if 0 if(!PS(serializer)) { - php_error_docref(E_ERROR, Cannot find serialization handler %s, new_value); + php_error_docref(NULL TSRMLS_CC, E_ERROR, Cannot find serialization +handler %s, new_value); } #endif return SUCCESS; -- 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/standard dl.c exec.c http_fopen_wrapper.c incomplete_class.c levenshtein.c link.c math.c pack.c reg.c scanf.c uniqid.c url.c var.c
helly Thu Dec 5 16:09:19 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/standard dl.c exec.c http_fopen_wrapper.c incomplete_class.c levenshtein.c link.c math.c pack.c reg.c scanf.c uniqid.c url.c var.c Log: MFH Index: php4/ext/standard/dl.c diff -u php4/ext/standard/dl.c:1.79 php4/ext/standard/dl.c:1.79.2.1 --- php4/ext/standard/dl.c:1.79 Mon Nov 4 07:53:24 2002 +++ php4/ext/standard/dl.c Thu Dec 5 16:09:18 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: dl.c,v 1.79 2002/11/04 12:53:24 moriyoshi Exp $ */ +/* $Id: dl.c,v 1.79.2.1 2002/12/05 21:09:18 helly Exp $ */ #include php.h #include dl.h @@ -220,7 +220,7 @@ zts= module_entry-zts; } - php_error(error_type, + php_error_docref(NULL TSRMLS_CC, error_type, %s: Unable to initialize module\n Module compiled with module API=%d, debug=%d, thread-safety=%d\n PHPcompiled with module API=%d, debug=%d, thread-safety=%d\n Index: php4/ext/standard/exec.c diff -u php4/ext/standard/exec.c:1.84 php4/ext/standard/exec.c:1.84.2.1 --- php4/ext/standard/exec.c:1.84 Mon Nov 4 12:38:30 2002 +++ php4/ext/standard/exec.cThu Dec 5 16:09:18 2002 @@ -15,7 +15,7 @@ | Author: Rasmus Lerdorf | +--+ */ -/* $Id: exec.c,v 1.84 2002/11/04 17:38:30 iliaa Exp $ */ +/* $Id: exec.c,v 1.84.2.1 2002/12/05 21:09:18 helly Exp $ */ #include stdio.h #include php.h @@ -72,7 +72,7 @@ larg0 = strlen(arg0); if (strstr(arg0, ..)) { - php_error(E_WARNING, No '..' components allowed in path); + php_error_docref(NULL TSRMLS_CC, E_WARNING, No '..' components +allowed in path); efree(arg0); return FAILURE; } Index: php4/ext/standard/http_fopen_wrapper.c diff -u php4/ext/standard/http_fopen_wrapper.c:1.53 php4/ext/standard/http_fopen_wrapper.c:1.53.2.1 --- php4/ext/standard/http_fopen_wrapper.c:1.53 Sat Oct 12 21:03:43 2002 +++ php4/ext/standard/http_fopen_wrapper.c Thu Dec 5 16:09:18 2002 @@ -18,7 +18,7 @@ | Wez Furlong [EMAIL PROTECTED] | +--+ */ -/* $Id: http_fopen_wrapper.c,v 1.53 2002/10/13 01:03:43 wez Exp $ */ +/* $Id: http_fopen_wrapper.c,v 1.53.2.1 2002/12/05 21:09:18 helly Exp $ */ #include php.h #include php_globals.h @@ -221,7 +221,7 @@ ua[ua_len] = 0; php_stream_write(stream, ua, ua_len); } else { - php_error(E_WARNING, Cannot construct User-agent header); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot +construct User-agent header); } if (ua) { Index: php4/ext/standard/incomplete_class.c diff -u php4/ext/standard/incomplete_class.c:1.14 php4/ext/standard/incomplete_class.c:1.14.4.1 --- php4/ext/standard/incomplete_class.c:1.14 Wed Jul 24 05:55:11 2002 +++ php4/ext/standard/incomplete_class.cThu Dec 5 16:09:18 2002 @@ -17,7 +17,7 @@ */ -/* $Id: incomplete_class.c,v 1.14 2002/07/24 09:55:11 yohgaki Exp $ */ +/* $Id: incomplete_class.c,v 1.14.4.1 2002/12/05 21:09:18 helly Exp $ */ #include php.h #include basic_functions.h @@ -37,17 +37,18 @@ { char buf[1024]; char *class_name; + TSRMLS_FETCH(); class_name = php_lookup_class_name(ref-object, NULL, 0); if (!class_name) class_name = estrdup(unknown); - snprintf(buf, 1023, INCOMPLETE_CLASS_MSG, class_name); + snprintf(buf, sizeof(buf)-1, INCOMPLETE_CLASS_MSG, class_name); efree(class_name); - php_error(error_type, %s, buf); + php_error_docref(NULL TSRMLS_CC, error_type, %s, buf); } /* }}} */ Index: php4/ext/standard/levenshtein.c diff -u php4/ext/standard/levenshtein.c:1.25 php4/ext/standard/levenshtein.c:1.25.4.1 --- php4/ext/standard/levenshtein.c:1.25Fri Aug 23 21:19:28 2002 +++ php4/ext/standard/levenshtein.c Thu Dec 5 16:09:18 2002 @@ -12,10 +12,10 @@ | obtain it through the world-wide-web, please send a note to | | [EMAIL PROTECTED] so we can mail you a copy immediately. | +--+ - | Author: Hartmut Holzgraefe [EMAIL PROTECTED] | + | Author: Hartmut Holzgraefe [EMAIL PROTECTED]|
Re: [PHP-CVS] cvs: php4 /ext/standard base64.c dl.c exec.c http_fopen_wrapper.c incomplete_class.c levenshtein.c link.c math.c pack.c reg.c scanf.c uniqid.c url.c var.c
At 22:01 05.12.2002, Derick Rethans wrote: On Thu, 5 Dec 2002, Marcus Boerger wrote: helly Thu Dec 5 15:59:50 2002 EDT Modified files: /php4/ext/standardbase64.c dl.c exec.c http_fopen_wrapper.c incomplete_class.c levenshtein.c link.c math.c pack.c reg.c scanf.c uniqid.c url.c var.c Log: -php_error - php_error_docref -removed some cases where emalloc result was tested Can you please remove \n from error messages too while you're at it? (sorry for all those comments :) Derick No worry - i prefer comments! The '\n' is needed in the base64 reverse table. For the rest i guess they are wanted, aren't they? marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard aggregation.c aggregation.h basic_functions.c
pollita Thu Dec 5 16:20:47 2002 EDT Modified files: /php4/ext/standard basic_functions.c aggregation.c aggregation.h Log: Bug #20746. Renamed aggregation_info() to aggregate_info() per naming conventions and created alias for BC. Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.545 php4/ext/standard/basic_functions.c:1.546 --- php4/ext/standard/basic_functions.c:1.545 Mon Dec 2 01:43:54 2002 +++ php4/ext/standard/basic_functions.c Thu Dec 5 16:20:47 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.545 2002/12/02 06:43:54 iliaa Exp $ */ +/* $Id: basic_functions.c,v 1.546 2002/12/05 21:20:47 pollita Exp $ */ #include php.h #include php_streams.h @@ -871,7 +871,8 @@ PHP_FE(aggregate_properties_by_regexp, first_arg_force_ref) #endif PHP_FE(deaggregate, first_arg_force_ref) - PHP_FE(aggregation_info,first_arg_force_ref) + PHP_FE(aggregate_info, first_arg_force_ref) + PHP_FALIAS(aggregation_info,aggregate_info, + first_arg_force_ref) PHP_FE(output_add_rewrite_var, NULL) PHP_FE(output_reset_rewrite_vars, NULL) Index: php4/ext/standard/aggregation.c diff -u php4/ext/standard/aggregation.c:1.11 php4/ext/standard/aggregation.c:1.12 --- php4/ext/standard/aggregation.c:1.11Fri Aug 23 21:19:27 2002 +++ php4/ext/standard/aggregation.c Thu Dec 5 16:20:47 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: aggregation.c,v 1.11 2002/08/24 01:19:27 helly Exp $ */ +/* $Id: aggregation.c,v 1.12 2002/12/05 21:20:47 pollita Exp $ */ #include php.h #include basic_functions.h @@ -536,7 +536,7 @@ /* {{{ proto array aggregation_info(object obj) */ -PHP_FUNCTION(aggregation_info) +PHP_FUNCTION(aggregate_info) { zval *obj; aggregation_info *aggr_info; Index: php4/ext/standard/aggregation.h diff -u php4/ext/standard/aggregation.h:1.2 php4/ext/standard/aggregation.h:1.3 --- php4/ext/standard/aggregation.h:1.2 Thu Feb 28 03:26:44 2002 +++ php4/ext/standard/aggregation.h Thu Dec 5 16:20:47 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: aggregation.h,v 1.2 2002/02/28 08:26:44 sebastian Exp $ */ +/* $Id: aggregation.h,v 1.3 2002/12/05 21:20:47 pollita Exp $ */ #ifndef AGGREGATION_H #define AGGREGATION_H @@ -46,6 +46,6 @@ PHP_FUNCTION(aggregate_properties_by_regexp); PHP_FUNCTION(aggregate); PHP_FUNCTION(deaggregate); -PHP_FUNCTION(aggregation_info); +PHP_FUNCTION(aggregate_info); #endif /* AGGREGATION_H */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/apache php_apache.c
helly Thu Dec 5 18:18:29 2002 EDT Modified files: /php4/sapi/apache php_apache.c Log: php_error - php_error_docref Index: php4/sapi/apache/php_apache.c diff -u php4/sapi/apache/php_apache.c:1.69 php4/sapi/apache/php_apache.c:1.70 --- php4/sapi/apache/php_apache.c:1.69 Thu Oct 24 09:14:48 2002 +++ php4/sapi/apache/php_apache.c Thu Dec 5 18:18:28 2002 @@ -17,7 +17,7 @@ | David Sklar [EMAIL PROTECTED] | +--+ */ -/* $Id: php_apache.c,v 1.69 2002/10/24 13:14:48 sas Exp $ */ +/* $Id: php_apache.c,v 1.70 2002/12/05 23:18:28 helly Exp $ */ #include php_apache_http.h @@ -115,11 +115,11 @@ ap_child_terminate( ((request_rec *)SG(server_context)) ); RETURN_TRUE; } else { /* tell them to get lost! */ - php_error(E_WARNING, apache.child_terminate is disabled); + php_error_docref(NULL TSRMLS_CC, E_WARNING, apache.child_terminate is +disabled); RETURN_FALSE; } #else - php_error(E_WARNING, apache_child_terminate() is not supported in this build); + php_error_docref(NULL TSRMLS_CC, E_WARNING, apache_child_terminate() +is not supported in this build); RETURN_FALSE; #endif } @@ -304,13 +304,13 @@ convert_to_string_ex(filename); if (!(rr = sub_req_lookup_uri ((*filename)-value.str.val, ((request_rec *) SG(server_context) { - php_error(E_WARNING, Unable to include '%s' - URI lookup failed, (*filename)-value.str.val); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - +URI lookup failed, (*filename)-value.str.val); if (rr) destroy_sub_req (rr); RETURN_FALSE; } if (rr-status != 200) { - php_error(E_WARNING, Unable to include '%s' - error finding URI, (*filename)-value.str.val); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - +error finding URI, (*filename)-value.str.val); if (rr) destroy_sub_req (rr); RETURN_FALSE; } @@ -319,7 +319,7 @@ php_header(); if (run_sub_req(rr)) { - php_error(E_WARNING, Unable to include '%s' - request execution failed, (*filename)-value.str.val); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - +request execution failed, (*filename)-value.str.val); if (rr) destroy_sub_req (rr); RETURN_FALSE; } else { @@ -415,7 +415,7 @@ convert_to_string_ex(filename); if(!(rr = sub_req_lookup_uri((*filename)-value.str.val, ((request_rec *) SG(server_context) { - php_error(E_WARNING, URI lookup failed, (*filename)-value.str.val); + php_error_docref(NULL TSRMLS_CC, E_WARNING, URI lookup failed, +(*filename)-value.str.val); RETURN_FALSE; } object_init(return_value); @@ -490,7 +490,7 @@ convert_to_string_ex(filename); if(!(rr = ap_sub_req_lookup_uri((*filename)-value.str.val, ((request_rec *) SG(server_context) { - php_error(E_WARNING, URI lookup failed, (*filename)-value.str.val); + php_error_docref(NULL TSRMLS_CC, E_WARNING, URI lookup failed, +(*filename)-value.str.val); RETURN_FALSE; } RETVAL_LONG(ap_run_sub_req(rr)); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /sapi/apache php_apache.c
helly Thu Dec 5 18:19:02 2002 EDT Modified files: (Branch: PHP_4_3) /php4/sapi/apache php_apache.c Log: MFH Index: php4/sapi/apache/php_apache.c diff -u php4/sapi/apache/php_apache.c:1.69 php4/sapi/apache/php_apache.c:1.69.2.1 --- php4/sapi/apache/php_apache.c:1.69 Thu Oct 24 09:14:48 2002 +++ php4/sapi/apache/php_apache.c Thu Dec 5 18:19:02 2002 @@ -17,7 +17,7 @@ | David Sklar [EMAIL PROTECTED] | +--+ */ -/* $Id: php_apache.c,v 1.69 2002/10/24 13:14:48 sas Exp $ */ +/* $Id: php_apache.c,v 1.69.2.1 2002/12/05 23:19:02 helly Exp $ */ #include php_apache_http.h @@ -115,11 +115,11 @@ ap_child_terminate( ((request_rec *)SG(server_context)) ); RETURN_TRUE; } else { /* tell them to get lost! */ - php_error(E_WARNING, apache.child_terminate is disabled); + php_error_docref(NULL TSRMLS_CC, E_WARNING, apache.child_terminate is +disabled); RETURN_FALSE; } #else - php_error(E_WARNING, apache_child_terminate() is not supported in this build); + php_error_docref(NULL TSRMLS_CC, E_WARNING, apache_child_terminate() +is not supported in this build); RETURN_FALSE; #endif } @@ -304,13 +304,13 @@ convert_to_string_ex(filename); if (!(rr = sub_req_lookup_uri ((*filename)-value.str.val, ((request_rec *) SG(server_context) { - php_error(E_WARNING, Unable to include '%s' - URI lookup failed, (*filename)-value.str.val); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - +URI lookup failed, (*filename)-value.str.val); if (rr) destroy_sub_req (rr); RETURN_FALSE; } if (rr-status != 200) { - php_error(E_WARNING, Unable to include '%s' - error finding URI, (*filename)-value.str.val); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - +error finding URI, (*filename)-value.str.val); if (rr) destroy_sub_req (rr); RETURN_FALSE; } @@ -319,7 +319,7 @@ php_header(); if (run_sub_req(rr)) { - php_error(E_WARNING, Unable to include '%s' - request execution failed, (*filename)-value.str.val); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to include '%s' - +request execution failed, (*filename)-value.str.val); if (rr) destroy_sub_req (rr); RETURN_FALSE; } else { @@ -415,7 +415,7 @@ convert_to_string_ex(filename); if(!(rr = sub_req_lookup_uri((*filename)-value.str.val, ((request_rec *) SG(server_context) { - php_error(E_WARNING, URI lookup failed, (*filename)-value.str.val); + php_error_docref(NULL TSRMLS_CC, E_WARNING, URI lookup failed, +(*filename)-value.str.val); RETURN_FALSE; } object_init(return_value); @@ -490,7 +490,7 @@ convert_to_string_ex(filename); if(!(rr = ap_sub_req_lookup_uri((*filename)-value.str.val, ((request_rec *) SG(server_context) { - php_error(E_WARNING, URI lookup failed, (*filename)-value.str.val); + php_error_docref(NULL TSRMLS_CC, E_WARNING, URI lookup failed, +(*filename)-value.str.val); RETURN_FALSE; } RETVAL_LONG(ap_run_sub_req(rr)); -- 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/calendar calendar.c
iliaa Thu Dec 5 18:19:03 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/calendar calendar.c Log: Fixed memory leaks inside heb_number_to_chars(). Index: php4/ext/calendar/calendar.c diff -u php4/ext/calendar/calendar.c:1.30 php4/ext/calendar/calendar.c:1.30.2.1 --- php4/ext/calendar/calendar.c:1.30 Thu Nov 7 09:52:02 2002 +++ php4/ext/calendar/calendar.cThu Dec 5 18:19:02 2002 @@ -18,7 +18,7 @@ | Wez Furlong [EMAIL PROTECTED]| +--+ */ -/* $Id: calendar.c,v 1.30 2002/11/07 14:52:02 wez Exp $ */ +/* $Id: calendar.c,v 1.30.2.1 2002/12/05 23:19:02 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -381,9 +381,9 @@ for example both: year '5' and year '5000' product 'ä'. use the numeric one for calculations. */ -static char* heb_number_to_chars(int n) +static char* heb_number_to_chars(int n, char **ret) { - char *p, *old, *ret; + char *p, *old; p = emalloc(10); old = p; @@ -392,8 +392,11 @@ prevents the option breaking the jewish beliefs, and some other critical resources ;) */ - if (n || n 1) + if (n || n 1) { + efree(old); + *ret = NULL; return NULL; + } /* alafim case */ if (n / 1000) { @@ -438,9 +441,10 @@ } *p = '\0'; - ret = emalloc((int) (p - old) + 1); - strncpy(ret, old, (int) (p - old) + 1); - return ret; + *ret = estrndup(old, (p - old) + 1); + p = *ret; + efree(old); + return p; } /* {{{ proto string jdtojewish(int juliandaycount) @@ -450,6 +454,7 @@ long julday, fl; int year, month, day; char date[10], hebdate[25]; + char *dayp, *yearp; if (ZEND_NUM_ARGS() == 1) { if (zend_parse_parameters(1 TSRMLS_CC,l, julday) != SUCCESS) { @@ -475,11 +480,14 @@ RETURN_FALSE; } - sprintf(hebdate, %s %s %s, \ - heb_number_to_chars(day), \ - JewishMonthHebName[month], \ - heb_number_to_chars(year)); + sprintf(hebdate, %s %s %s, heb_number_to_chars(day, dayp), +JewishMonthHebName[month], heb_number_to_chars(year, yearp)); + if (dayp) { + efree(dayp); + } + if (yearp) { + efree(yearp); + } RETURN_STRING(hebdate, 1); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: CVSROOT / avail
ssb Thu Dec 5 18:23:43 2002 EDT Modified files: /CVSROOTavail Log: * arnaud += pearweb/weeklynews Index: CVSROOT/avail diff -u CVSROOT/avail:1.555 CVSROOT/avail:1.556 --- CVSROOT/avail:1.555 Wed Dec 4 19:39:30 2002 +++ CVSROOT/avail Thu Dec 5 18:23:42 2002 @@ -50,7 +50,7 @@ avail|cox,mj,vblavet|php4/pear avail|alan_k,chagenbu,cmv,cox,derick,dickmann,jon,mj,pajoye,richard,tal|pearweb -avail|alexmerz,bjoern,chregu,dams,david,jmcastagnetto,rashid,tuupola|pearweb/weeklynews +avail|alexmerz,arnaud,bjoern,chregu,dams,david,jmcastagnetto,rashid,tuupola|pearweb/weeklynews avail|philip,sroebke|peardoc avail|nicos|pear,peardoc -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/gd gd.c php_gd.h
pajoye Thu Dec 5 21:16:07 2002 EDT Modified files: /php4/ext/gdgd.c php_gd.h Log: Add imageistruecolor Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.234 php4/ext/gd/gd.c:1.235 --- php4/ext/gd/gd.c:1.234 Wed Dec 4 18:21:30 2002 +++ php4/ext/gd/gd.cThu Dec 5 21:16:06 2002 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.234 2002/12/04 23:21:30 rasmus Exp $ */ +/* $Id: gd.c,v 1.235 2002/12/06 02:16:06 pajoye Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -156,12 +156,13 @@ PHP_FE(imageellipse,NULL) PHP_FE(imagechar, NULL) PHP_FE(imagecharup, NULL) + PHP_FE(imagecolorat,NULL) PHP_FE(imagecolorallocate, NULL) #if HAVE_LIBGD15 PHP_FE(imagepalettecopy,NULL) PHP_FE(imagecreatefromstring, NULL) #endif - PHP_FE(imagecolorat,NULL) + PHP_FE(imageistruecolor,NULL) PHP_FE(imagecolorclosest, NULL) #if HAVE_COLORCLOSESTHWB PHP_FE(imagecolorclosesthwb,NULL) @@ -1747,6 +1748,23 @@ zend_list_delete(Z_LVAL_PP(IM)); RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto int imagecolorallocate(int im, int red, int green, int blue) + Allocate a color for an image */ +PHP_FUNCTION(imageistruecolor) +{ + zval **IM; + gdImagePtr im; + + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, IM) == FAILURE) { + ZEND_WRONG_PARAM_COUNT(); + } + + ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, Image, le_gd); + + RETURN_BOOL(im-trueColor); } /* }}} */ Index: php4/ext/gd/php_gd.h diff -u php4/ext/gd/php_gd.h:1.46 php4/ext/gd/php_gd.h:1.47 --- php4/ext/gd/php_gd.h:1.46 Sat Nov 23 17:11:59 2002 +++ php4/ext/gd/php_gd.hThu Dec 5 21:16:06 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_gd.h,v 1.46 2002/11/23 22:11:59 moriyoshi Exp $ */ +/* $Id: php_gd.h,v 1.47 2002/12/06 02:16:06 pajoye Exp $ */ #ifndef PHP_GD_H #define PHP_GD_H @@ -64,6 +64,7 @@ PHP_FUNCTION(imagearc); PHP_FUNCTION(imagechar); PHP_FUNCTION(imagecharup); +PHP_FUNCTION(imageistruecolor); PHP_FUNCTION(imagecolorallocate); PHP_FUNCTION(imagepalettecopy); PHP_FUNCTION(imagecolorat); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/ftp php_ftp.c
iliaa Fri Dec 6 01:07:40 2002 EDT Modified files: /php4/ext/ftp php_ftp.c Log: Fixed bug #20812, ftp_get returned NULL on success instead of TRUE. Index: php4/ext/ftp/php_ftp.c diff -u php4/ext/ftp/php_ftp.c:1.74 php4/ext/ftp/php_ftp.c:1.75 --- php4/ext/ftp/php_ftp.c:1.74 Thu Oct 3 07:33:05 2002 +++ php4/ext/ftp/php_ftp.c Fri Dec 6 01:07:40 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_ftp.c,v 1.74 2002/10/03 11:33:05 sesser Exp $ */ +/* $Id: php_ftp.c,v 1.75 2002/12/06 06:07:40 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -624,6 +624,7 @@ } php_stream_close(outstream); + RETURN_TRUE; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS /sapi/fastcgi .cvsignore CREDITS Makefile.frag README.Apache README.FastCGI config.m4 fastcgi.c fastcgi.dsp php.sym php_fastcgi.h windows.txt
sebastian Fri Dec 6 01:08:17 2002 EDT Removed files: /php4/sapi/fastcgi .cvsignore CREDITS Makefile.frag README.Apache README.FastCGI config.m4 fastcgi.c fastcgi.dsp php.sym php_fastcgi.h windows.txt Modified files: /php4 NEWS Log: Deprecate sapi/fastcgi. Index: php4/NEWS diff -u php4/NEWS:1.1267 php4/NEWS:1.1268 --- php4/NEWS:1.1267Wed Dec 4 12:31:35 2002 +++ php4/NEWS Fri Dec 6 01:08:16 2002 @@ -11,12 +11,13 @@ - 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. -- Removed extensions: (Jan, Jani) +- Removed extensions: (Jan, Jani, Sebastian) . ext/aspell . ext/ccvs . ext/cybercash . ext/icap . sapi/fhttpd + . sapi/fastcgi - Moved extensions to PECL (http://pear.php.net/): (James, Derick) . ext/vpopmail . ext/cybermut -- 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/ftp php_ftp.c
iliaa Fri Dec 6 01:08:21 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/ftp php_ftp.c Log: MFH Index: php4/ext/ftp/php_ftp.c diff -u php4/ext/ftp/php_ftp.c:1.74 php4/ext/ftp/php_ftp.c:1.74.2.1 --- php4/ext/ftp/php_ftp.c:1.74 Thu Oct 3 07:33:05 2002 +++ php4/ext/ftp/php_ftp.c Fri Dec 6 01:08:21 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_ftp.c,v 1.74 2002/10/03 11:33:05 sesser Exp $ */ +/* $Id: php_ftp.c,v 1.74.2.1 2002/12/06 06:08:21 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -624,6 +624,7 @@ } php_stream_close(outstream); + RETURN_TRUE; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/ircg ircg.c
sas Fri Dec 6 01:08:59 2002 EDT Modified files: /php4/ext/ircg ircg.c Log: added a hook-registration function similiar to irc_connect() for the write buffer. we register a callback for closed-conn notification and an async handler for write_buf_add completion, so that we can maintain proper reference counts. we also call the global IRCG init function only once. this proves to be successful all the time and even apachectl restart/graceful works beautifully now. Index: php4/ext/ircg/ircg.c diff -u php4/ext/ircg/ircg.c:1.156 php4/ext/ircg/ircg.c:1.157 --- php4/ext/ircg/ircg.c:1.156 Thu Dec 5 10:35:04 2002 +++ php4/ext/ircg/ircg.cFri Dec 6 01:08:59 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: ircg.c,v 1.156 2002/12/05 15:35:04 sas Exp $ */ +/* $Id: ircg.c,v 1.157 2002/12/06 06:08:59 sas Exp $ */ /* {{{ includes */ @@ -1047,11 +1047,24 @@ } /* }}} */ -static void wbuf_dead(irc_write_buf *p, void *data) +static void wbuf_closed_conn(irc_write_buf *p, void *data) { irc_disconnect(data, Client connection terminated); } +static void wbuf_add_complete(irc_write_buf *p, void *data) +{ + php_irconn_t *conn = data; + + put_irconn(data); +} + +static void wbuf_hooks(irc_write_buf *p, void *data) +{ + irc_write_buf_reg(p, WB_CLOSED_CONN, wbuf_closed_conn); + irc_write_buf_reg(p, WB_ADD_COMPLETE, wbuf_add_complete); +} + /* {{{ proto bool ircg_set_current(int connection) Sets current connection for output */ PHP_FUNCTION(ircg_set_current) @@ -1099,7 +1112,8 @@ irc_write_buf_add(conn-wb, conn-fd); if (1) { #else - if (irc_write_buf_add_ex(conn-wb, conn-fd, wbuf_dead, conn) == 0) { + if (irc_write_buf_add_ex(conn-wb, conn-fd, wbuf_hooks, +conn) == 0) { + ircg_resource_get(conn-irconn_id); #endif php_ircg-irc_set_currents++; IRCGG(flush_data) = conn; @@ -2135,7 +2149,7 @@ } } -static pid_t initialized_from; +static int initialized; /* {{{ PHP_MINIT_FUNCTION */ @@ -2157,14 +2171,16 @@ } #endif - initialized_from = getpid(); + if (initialized == 0) { + initialized = 1; #if IRCG_API_VERSION = 20021127 - ircg_setup_global(/tmp/ircg.lock, 0, setup); + ircg_setup_global(/tmp/ircg.lock, 0, setup); #else - setup(0); - setup(1); + setup(0); + setup(1); #endif + } ircg_hash_init(php_ircg-h_fmt_msgs, 0, NULL, fmt_msgs_dtor, 1); #ifdef USE_FD2IRCONN @@ -2188,15 +2204,6 @@ ircg_hash_destroy(h_fd2irconn); #endif - if (getpid() == initialized_from) { - ircg_hash_destroy(php_ircg-h_fmt_msgs); - - IRCG_LOCK_DESTROY(php_ircg-fmt_msgs_lock); - IRCG_LOCK_DESTROY(php_ircg-error_msgs_lock); - - ircg_shutdown_global(); - } - return SUCCESS; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/ircg config.m4
sas Fri Dec 6 01:27:01 2002 EDT Modified files: /php4/ext/ircg config.m4 Log: enable shared build Index: php4/ext/ircg/config.m4 diff -u php4/ext/ircg/config.m4:1.17 php4/ext/ircg/config.m4:1.18 --- php4/ext/ircg/config.m4:1.17Tue Dec 3 05:13:36 2002 +++ php4/ext/ircg/config.m4 Fri Dec 6 01:27:01 2002 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.17 2002/12/03 10:13:36 sas Exp $ +dnl $Id: config.m4,v 1.18 2002/12/06 06:27:01 sas Exp $ dnl PHP_ARG_WITH(ircg, for IRCG support, @@ -9,8 +9,8 @@ [ --with-ircg-config=PATH IRCG: Path to the ircg-config script], [ IRCG_CONFIG=$withval ], [ -if test $with_ircg != yes test $with_ircg != no; then - IRCG_CONFIG=$with_ircg/bin/ircg-config +if test $PHP_IRCG != yes test $PHP_IRCG != no; then + IRCG_CONFIG=$PHP_IRCG/bin/ircg-config else IRCG_CONFIG=ircg-config fi @@ -22,19 +22,21 @@ AC_MSG_ERROR([I cannot run the ircg-config script which should have been installed by IRCG. Please ensure that the script is in your PATH or point --with-ircg-config to the path of the script.]) fi - PHP_EVAL_LIBLINE(`$IRCG_CONFIG --ldflags`) + PHP_EVAL_LIBLINE(`$IRCG_CONFIG --ldflags`, IRCG_SHARED_LIBADD) PHP_EVAL_INCLINE(`$IRCG_CONFIG --cppflags`) - PHP_ADD_LIBRARY_WITH_PATH(ircg, $PHP_IRCG/lib) + PHP_ADD_LIBRARY_WITH_PATH(ircg, $PHP_IRCG/lib, IRCG_SHARED_LIBADD) PHP_ADD_INCLUDE($PHP_IRCG/include) - PHP_NEW_EXTENSION(ircg,[ ircg.c ircg_scanner.c php_ircg_cache.c \ - php_ircg_conversion.c php_ircg_error.c php_ircg_tokenizer.c], - $ext_shared) + PHP_SUBST(IRCG_SHARED_LIBADD) + ircg_src=ircg_common.c if test $PHP_SAPI = thttpd; then +ircg_src= PHP_ADD_SOURCES(PHP_EXT_DIR(ircg),ircg_thttpd.c,[],sapi) PHP_ADD_SOURCES(PHP_EXT_DIR(ircg),ircg_common.c,[],cli) - else -PHP_ADD_SOURCES(PHP_EXT_DIR(ircg),ircg_common.c) fi + PHP_NEW_EXTENSION(ircg,[ ircg.c ircg_scanner.c php_ircg_cache.c $ircg_src \ + php_ircg_conversion.c php_ircg_error.c php_ircg_tokenizer.c], + $ext_shared) + unset ircg_src AC_DEFINE(HAVE_IRCG, 1, [Whether you want IRCG support]) PHP_ADD_MAKEFILE_FRAGMENT fi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/servlet README
sebastian Fri Dec 6 01:44:28 2002 EDT Modified files: /php4/sapi/servlet README Log: A bit of an update for the sapi/servlet installation guide. Index: php4/sapi/servlet/README diff -u php4/sapi/servlet/README:1.13 php4/sapi/servlet/README:1.14 --- php4/sapi/servlet/README:1.13 Sun Oct 6 02:27:11 2002 +++ php4/sapi/servlet/READMEFri Dec 6 01:44:28 2002 @@ -36,7 +36,7 @@ compilation tasks. - Installing PHP as a Servlet into Apache's Jakarta Tomcat + Installing PHP as a Servlet into Apache's Jakarta Tomcat [*] 1.) Build the PHP 4 Java Servlet SAPI Module @@ -47,57 +47,43 @@ o ./configure --with-servlet --with-java - o Add directory containing libphp4.so to LD_LIBRARY_PATH + o Add directory containing libphp4.so to LD_LIBRARY_PATH. Windows o Build ext/java/java.dsp, copy php_java.dll to your extension_dir directory and enable the extension in the -php.ini +php.ini. - o Build sapi/servlet/servlet.dsp + o Build sapi/servlet/servlet.dsp. - o Add directory containing php4ts.dll and phpsrvlt.dll to -PATH + o Add the directory containing php4ts.dll and phpsrvlt.dll to +the PATH environment variable. -2.) Tomcat 3 +2.) Copy phpsrvlt.jar into your $TOMCAT_HOME/shared/lib directory. - * Add phpsrvlt.jar to CLASSPATH +3.) Merge the configuration directives from web.xml file that +comes with the Java Servlet SAPI Module into your +$TOMCAT_HOME/conf/web.xml configuration file. -Tomcat 4 +Make sure that the element ordering of the web.xml is legal +with Tomcat and put all the servlet declarations first, +followed by all the servlet-mapping declarations. - * Copy phpsrvlt.jar into your $CATALINA_HOME/lib directory +Add -3.) Tomcat 3 + welcome-fileindex.php/welcome-file - * Merge or overwrite build/tomcat/examples/WEB-INF/web.xml -with the configuration directives from the web.xml file -that comes with the Java Servlet SAPI Module. +to the -Tomcat 4 - - * Merge the configuration directives from web.xml file that -comes with the Java Servlet SAPI Module into your -Tomcat/conf/web.xml configuration file. + welcome-file-list +... + /welcome-file-list -Make sure that the element ordering of the web.xml is legal -with Tomcat and put all the servlet declarations first, -followed by all the servlet-mapping declarations. - - * Add - - welcome-fileindex.php/welcome-file - -to the - - welcome-file-list -... - /welcome-file-list - -block of your Tomcat/conf/web.xml configuration file. +block of your $TOMCAT_HOME/conf/web.xml configuration file. 4.) Test your installation by creating a test.php file in your -Tomcat/webapps/ROOT directory with +$TOMCAT_HOME/webapps/ROOT directory with ?php phpinfo(); ? @@ -120,6 +106,8 @@ and build Cocoon. -- + [*] The instructions herein have been tested with Tomcat 4.1.12. + [1] http://jakarta.apache.org/tomcat/ [2] http://xml.apache.org/cocoon2/ [3] http://www.php.net/support.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/ircg ircg.c
sas Fri Dec 6 01:52:47 2002 EDT Modified files: /php4/ext/ircg ircg.c Log: fix uninitialized pointer issue Index: php4/ext/ircg/ircg.c diff -u php4/ext/ircg/ircg.c:1.157 php4/ext/ircg/ircg.c:1.158 --- php4/ext/ircg/ircg.c:1.157 Fri Dec 6 01:08:59 2002 +++ php4/ext/ircg/ircg.cFri Dec 6 01:52:47 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: ircg.c,v 1.157 2002/12/06 06:08:59 sas Exp $ */ +/* $Id: ircg.c,v 1.158 2002/12/06 06:52:47 sas Exp $ */ /* {{{ includes */ @@ -1704,6 +1704,7 @@ while (zend_hash_get_current_key_ex(Z_ARRVAL_PP(array), str, str_len, num, 0, pos) == HASH_KEY_IS_STRING) { zend_hash_get_current_data_ex(Z_ARRVAL_PP(array), (void **) val, pos); convert_to_string_ex(val); + fmt = 0; php_ircg_token_compiler(Z_STRVAL_PP(val), fmt); ircg_hash_add(conn-ctcp_msgs, str, str_len - 1, fmt, sizeof(fmt), NULL); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php