Make WordPress Core

Opened 9 years ago

Last modified 8 years ago

#10779 closed enhancement

file.php: PHPDoc + optimised unzip_file() — at Version 1

Reported by: dd32 Owned by: dd32
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9
Component: Filesystem API Keywords: needs-testing featured
Focuses: Cc:

Description (last modified by dd32)

Patch contains 2 sections:

  • Much improved PHPDoc coverage for filesystem-related functions in file.php
  • Optimised unzip_file() function
    • Reduced the number of IO operations required (mainly is_dir())
    • Simplifies logic to make reading easier.

--- Also note, I played with extracting a file at a time from the ZIP, and writing to the filesystem directly, While it decreased the memory usage from ~12MB to 3MB for the entire unzip operation, It increased the operation time from 5s to 70s, So i've left it to consume memory in order to speed things up.

Change History (3)

9 years ago

#1 @dd32
9 years ago

  • Description modified (diff)

9 years ago

s/for/foreach on a loop for readability

Note: See TracTickets for help on using tickets.