[wp-trac] [WordPress Trac] #37719: Pre/Post Unzip Hooks

WordPress Trac noreply at wordpress.org
Mon Sep 25 22:14:28 UTC 2023


#37719: Pre/Post Unzip Hooks
---------------------------------------------+----------------------
 Reporter:  dfavor                           |       Owner:  costdev
     Type:  feature request                  |      Status:  closed
 Priority:  normal                           |   Milestone:  6.4
Component:  Filesystem API                   |     Version:  3.0
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+----------------------
Changes (by costdev):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"56689" 56689]:
 {{{
 #!CommitTicketReference repository="" revision="56689"
 Filesystem API: Introduce filters for before/after unzipping archives.

 This introduces the following new filters which wrap the process of
 unzipping an archive:
 - `pre_unzip_file` - Filters archive unzipping to allow an override with a
 custom process.
 - `unzip_file` - Filters the result of unzipping an archive.

 Both filters pass the following:
 - `string $file` - Full path and filename of ZIP archive.
 - `string $to` - Full path on the filesystem to extract archive to.
 - `string[] $needed_dirs` - A full list of required folders that need to
 be created.
 - `float|false $required_space` - The space required to unzip the file and
 copy its contents, with a 10% buffer.

 Props dfavor, azaozz, oglekler, afragen, costdev.
 Fixes #37719.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/37719#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list