PHP Classes
elePHPant
Icontem

Patch for 4.4.3

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      PHP Classes blog  >  File upload progress ...  >  All threads  >  Patch for 4.4.3  >  (Un) Subscribe thread alerts  
Subject:Patch for 4.4.3
Summary:I need a patch for 4.4.3
Messages:14
Author:Hammad Tariq
Date:2006-12-22 10:19:22
Update:2007-07-16 23:50:28
 
  1 - 10   11 - 14  

  1. Patch for 4.4.3   Reply   Report abuse  
Picture of Hammad Tariq Hammad Tariq - 2006-12-22 18:24:30
Hello,
Great work I must say and really impressed by the story of the site. I just recently discovered this site due to the class of msn grabber but astonished to see the work here...ofcourse now I dont need to do everything of me own.

When I got the mail of your this blog, I was just astonished that how you get to know that I am in desparate need of a progress meter these day and was just wondering that if its possible in PHP. :)

Unfortunately, you havn't provided patch for 4.4.3 while my hosting company is using this version. Can you make one and provide us?

Regards,
Hammad

  2. Re: Patch for 4.4.3   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-12-22 19:55:34 - In reply to message 1 from Hammad Tariq
There have been no changes to the pertinent files between PHP 4.4.3 and 4.4.4. Therefore you can use the same patch for PHP 4.4.4 .

  3. Re: Patch for 4.4.3   Reply   Report abuse  
Picture of Guillermo Guillermo - 2007-07-13 17:17:18 - In reply to message 2 from Manuel Lemos
I have Php 4.4.7, can I use this patch anyway ?

Thanks.

  4. Re: Patch for 4.4.3   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-07-13 17:18:52 - In reply to message 3 from Guillermo
I think you can, although I am not sure if the patched code sections changed with the version you are using. Just try applying the patch and see if it gives you an conflicts.

  5. Re: Patch for 4.4.3   Reply   Report abuse  
Picture of Guillermo Guillermo - 2007-07-13 19:35:07 - In reply to message 4 from Manuel Lemos
Thanks, I tried but this is what I get:
patch < rfc1867.php-4.4.4.patch
patching file rfc1867.c
Hunk #4 FAILED at 753.
Hunk #5 FAILED at 765.
Hunk #6 succeeded at 792 (offset 1 line).
Hunk #8 succeeded at 828 (offset 1 line).
Hunk #10 FAILED at 917.
Hunk #11 succeeded at 958 (offset 1 line).
Hunk #13 succeeded at 1036 (offset 1 line).
Hunk #15 succeeded at 1092 (offset 1 line).
3 out of 16 hunks FAILED -- saving rejects to file rfc1867.c.rej
patching file rfc1867.h

and in the rfc1867.c.rej

cat rfc1867.c.rej
***************
*** 749,755 ****
XXX: this is horrible memory-usage-wise, but we only expect
to do this on small pieces of form data.
*/
! static char *multipart_buffer_read_body(multipart_buffer *self TSRMLS_DC)
{
char buf[FILLUNIT], *out=NULL;
int total_bytes=0, read_bytes=0;
--- 753,759 ----
XXX: this is horrible memory-usage-wise, but we only expect
to do this on small pieces of form data.
*/
! static char *multipart_buffer_read_body(multipart_buffer *self, unsigned int *len TSRMLS_DC)
{
char buf[FILLUNIT], *out=NULL;
int total_bytes=0, read_bytes=0;
***************
*** 761,766 ****
}

if (out) out[total_bytes] = '\0';

return out;
}
--- 765,771 ----
}

if (out) out[total_bytes] = '\0';
+ *len = total_bytes;

return out;
}
***************
*** 895,907 ****

/* Normal form variable, safe to read all data into memory */
if (!filename && param) {
!
! char *value = multipart_buffer_read_body(mbuff TSRMLS_CC);

if (!value) {
value = estrdup("");
}

#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING)
if (php_mb_encoding_translation(TSRMLS_C)) {
php_mb_gpc_stack_variable(param, value, &val_list, &len_list,
--- 917,941 ----

/* Normal form variable, safe to read all data into memory */
if (!filename && param) {
! unsigned int value_len;
! char *value = multipart_buffer_read_body(mbuff, &value_len TSRMLS_CC);
! unsigned int new_val_len; /* Dummy variable */

if (!value) {
value = estrdup("");
}

+ if (php_rfc1867_callback != NULL) {
+ multipart_event_formdata event_formdata;
+
+ event_formdata.post_bytes_processed = SG(read_post_bytes);
+ event_formdata.name = param;
+ event_formdata.value = &value;
+ event_formdata.length = value_len;
+ event_formdata.newlength = NULL;
+ php_rfc1867_callback(MULTIPART_EVENT_FORMDATA, &event_formdata, &event_extra_data TSRMLS_CC);
+ }
+
#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING)
if (php_mb_encoding_translation(TSRMLS_C)) {
php_mb_gpc_stack_variable(param, value, &val_list, &len_list,

  6. Re: Patch for 4.4.3   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-07-13 19:37:01 - In reply to message 5 from Guillermo
Hummmm... I am afraid that the patch needs work to adapt it for PHP 4.4.7 .

  7. Re: Patch for 4.4.3   Reply   Report abuse  
Picture of Guillermo Guillermo - 2007-07-13 21:21:08 - In reply to message 6 from Manuel Lemos
ok, the last question. Imagine that I adapt the patch and works. Then, compile php.. and that's it? Or I must download and build the uploadprogress.so with pecl/pear and add the same in the php.ini.
Thank you. Best regards.

  8. Re: Patch for 4.4.3   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-07-13 21:23:57 - In reply to message 7 from Guillermo
Yes, the upload progress extension is necessary actually report the progress. The patch only inserts a callback function that the upload progress extension uses.

BTW, if you fix the patch and it work with PHP 4.4.7, it would be nice if you could contribute it back to everybody that would like to use it.

  9. Re: Patch for 4.4.3   Reply   Report abuse  
Picture of Guillermo Guillermo - 2007-07-14 00:32:00 - In reply to message 8 from Manuel Lemos
I think I have the patch but when I try to install uploadprogress ....
pecl install uploadprogress-0.3.0.tgz
pecl/uploadprogress requires PHP (version >= 5.2.0), installed version is 4.4.7
No valid packages found
install failed

Is there another way to install and compile the package to see if the patch works?
Tanks.

  10. Re: Patch for 4.4.3   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-07-14 00:35:26 - In reply to message 9 from Guillermo
No, it does not require PHP 5.2 . What it requires is what the patch adds. Without the patch, what the patch adds is only available with PHP 5.2.

You can either alter the package to correct the version dependency or install the upload progress extension using the regular sequence of commands:

phpize
configure
make
make install

 
  1 - 10   11 - 14