Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove debugging
  • Loading branch information
pento committed Oct 10, 2017
commit d27f8b603f91d19854765ad919ea75999abf335d
6 changes: 0 additions & 6 deletions src/wp-admin/includes/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,31 +144,25 @@ function list_files( $folder = '', $levels = 100, $exclusions = array() ) {
if ( $dir ) {
while ( ( $file = readdir( $dir ) ) !== false ) {
// Skip current and parent folder links.
var_dump( $dir, $file );
if ( in_array( $file, array( '.', '..' ), true ) ) {
continue;
}
echo 1;

// Skip hidden and excluded files.
if ( '.' === $file[0] || in_array( $file, $exclusions, true ) ) {
continue;
}
echo 2;

if ( is_dir( $folder . $file ) ) {
echo 3;
$files2 = list_files( $folder . $file, $levels - 1 );
if ( $files2 ) {
$files = array_merge($files, $files2 );
} else {
$files[] = $folder . $file . '/';
}
} else {
echo 4;
$files[] = $folder . $file;
}
var_dump( $files );
}
}
@closedir( $dir );
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/admin/includesPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function test_get_plugin_files_folder() {
'list_files_test_plugin/list_files_test_plugin.php',
'list_files_test_plugin/subdir/subfile.php',
);
$this->assertEquals( $expected, $plugin_files );
$this->assertEqualSets( $expected, $plugin_files );

unlink( $sub_dir . '/subfile.php' );
unlink( $plugin[1] );
Expand Down