[wp-trac] [WordPress Trac] #21403: Introduce wp_scandir, remove opendir / closedir code

WordPress Trac wp-trac at lists.automattic.com
Sat Jul 28 08:57:21 UTC 2012


#21403: Introduce wp_scandir, remove opendir / closedir code
----------------------------+-----------------------------
 Reporter:  wonderboymusic  |      Owner:
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Filesystem      |    Version:  3.0
 Severity:  normal          |   Keywords:  has-patch
----------------------------+-----------------------------
 There is {{{@opendir}}} code all over the place that is not standardized.
 On top of that, there is plenty of code that is duplicated and could be
 condensed into one handy function. Plus, in all of the places we are using
 {{{opendir()}}}, we really want to be using {{{scandir()}}}.

 I have created a master function in {{{load.php}}} called
 {{{wp_scandir()}}} that does the basics:
 * scans a directory for files / subdirectories
 * filters list by extension(s)
 * optionally returns ONLY files

 This cleans up code in many places.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21403>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list