#623 (ok 3.5) send ZIP archive to stdout

closed-accepted
1
2012-04-07
2011-04-04
Brian Carcich
No

This patch adds the feature for zip.lib.php to send the ZIP archive contents to STDOUT instead of returning them as a string.

The advantage is that this method uses far less memory (php.ini: memory_limit) and is less likely to generate an error when run in a web server cgi script. For example, with memory_limit = 16M in php.ini, the largest ZIP archive that can be written with the existing code is about 5MB; with the modified code the largest ZIP archive that could be written with the patched code could easily reach the 4GiB limit of the 32-bit ZIP format.

This patch supersedes patch 3271853.

Discussion

  • Brian Carcich
    Brian Carcich
    2011-04-04

     
    Attachments
  • Michal Čihař
    Michal Čihař
    2011-04-05

    I think all the creating of header should be there just once, it does not need that much space to store it to memory and then either append to result or echo it. This way the potentially fragile code will be existing only in single copy.

     
  • Michal Čihař
    Michal Čihař
    2011-04-05

    • assigned_to: nobody --> nijel
     
  • Michal Čihař
    Michal Čihař
    2011-04-05

    Aslo as I wrote before, there should be some uses of setDoWrite() inside phpMyAdmin, otherwise I don't see much reasons for adding code which is not used at all.

     
  • Michal Čihař
    Michal Čihař
    2011-05-17

    • priority: 5 --> 1
    • summary: Patch for Feature 3271770: send ZIP archive to stdout --> (ok 3.5) send ZIP archive to stdout
    • status: open --> open-accepted
     
  • Michal Čihař
    Michal Čihař
    2011-05-17

    Merged with changes I've asked for before.

     
  • Michal Čihař
    Michal Čihař
    2011-05-17

    Your patch was merged in the repository, thanks.

     
  • Marc Delisle
    Marc Delisle
    2012-04-07

    • status: open-accepted --> closed-accepted