[wp-trac] [WordPress Trac] #31066: wp_upload_dir calls wp_mkdir_p on each invocation
WordPress Trac
noreply at wordpress.org
Tue Jan 20 06:27:03 UTC 2015
#31066: wp_upload_dir calls wp_mkdir_p on each invocation
----------------------------+-----------------------------
Reporter: rmccue | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Filesystem API | Version:
Severity: normal | Keywords:
Focuses: |
----------------------------+-----------------------------
Every time `wp_upload_dir` is called, `wp_mkdir_p` is also called. For
normal filesystems, this is not a huge issue, but using external
filesystems (S3, etc) potentially means an external request on every call.
Ideally, I'd actually like to avoid calling `wp_mkdir_p` at all there. S3
(along with a few other external FSes) doesn't actually have a concept of
directories; rather they're just part of the filename. Adding a
`upload_dir_requires_creation` filter to `wp_upload_dir` would help with
this, as plugins could then switch this off if they know the underlying FS
doesn't need it, or they already handle it themselves.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31066>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list