198 | | $plugins_dir = @ opendir( $dir ); |
199 | | if ( $plugins_dir ) { |
200 | | while (($file = readdir( $plugins_dir ) ) !== false ) { |
201 | | if ( substr($file, 0, 1) == '.' ) |
202 | | continue; |
203 | | if ( is_dir( $dir . '/' . $file ) ) { |
204 | | $plugins_subdir = @ opendir( $dir . '/' . $file ); |
205 | | if ( $plugins_subdir ) { |
206 | | while (($subfile = readdir( $plugins_subdir ) ) !== false ) { |
207 | | if ( substr($subfile, 0, 1) == '.' ) |
208 | | continue; |
209 | | $plugin_files[] = plugin_basename("$dir/$file/$subfile"); |
210 | | } |
211 | | @closedir( $plugins_subdir ); |
212 | | } |
213 | | } else { |
214 | | if ( plugin_basename("$dir/$file") != $plugin ) |
215 | | $plugin_files[] = plugin_basename("$dir/$file"); |
216 | | } |
217 | | } |
218 | | @closedir( $plugins_dir ); |
219 | | } |
| 198 | $objects = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::SELF_FIRST ); |
| 199 | foreach( $objects as $name => $object ){ |
| 200 | if( is_dir( $name ) ) |
| 201 | continue; |
| 202 | |
| 203 | if ( substr( $name, 0, 1 ) == '.' ) |
| 204 | continue; |
| 205 | |
| 206 | $plugin_files[] = plugin_basename( $name ); |
| 207 | } |