Changeset 6026
- Timestamp:
- 10/13/2017 11:31:06 PM (7 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php
r5996 r6026 264 264 private function get_plugin_root( $dir ) { 265 265 $plugin_root = ''; 266 $plugin_files = Filesystem::list_files( $dir, true /* Recursive */, '!\.php$!i' );266 $plugin_files = Filesystem::list_files( $dir, true /* Recursive */, '!\.php$!i', 1 /* Depth */ ); 267 267 268 268 foreach ( $plugin_files as $plugin_file ) { -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php
r5841 r6026 61 61 $this->plugin_dir = Filesystem::unzip( $zip_file ); 62 62 63 $plugin_files = Filesystem::list_files( $this->plugin_dir, true /* Recursive */, '!\.php$!i' );63 $plugin_files = Filesystem::list_files( $this->plugin_dir, true /* Recursive */, '!\.php$!i', 1 /* Depth */ ); 64 64 foreach ( $plugin_files as $plugin_file ) { 65 65 $plugin_data = get_plugin_data( $plugin_file, false, false ); // No markup/translation needed. -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tools/class-filesystem.php
r3512 r6026 81 81 * @param bool $recursive Optional. Whether to recurse into subdirectories. Default: false. 82 82 * @param string $pattern Optional. A regular expression to match files against. Default: null. 83 * @param int $depth Optional. Recursion depth. Default: -1 (infinite). 83 84 * @return array All files within the passed directory. 84 85 */ 85 public static function list_files( $directory, $recursive = false, $pattern = null ) {86 public static function list_files( $directory, $recursive = false, $pattern = null, $depth = -1 ) { 86 87 if ( $recursive ) { 87 88 $iterator = new \RecursiveIteratorIterator( … … 89 90 \RecursiveIteratorIterator::SELF_FIRST 90 91 ); 92 93 if ( $depth > -1 ) { 94 $iterator->setMaxDepth( $depth ); 95 } 91 96 } else { 92 97 $iterator = new \DirectoryIterator( $directory );
Note: See TracChangeset
for help on using the changeset viewer.