Skip to content

Commit e7611ac

Browse files
joe9663bwmarkle
andauthored
16213 logging additions for get_filtered_filelist (#496)
* adds file extensions listed in issue #234 to the default exclude list * fixes typo for adding .wpress files to exclusion list * adds logging for UE ticket 16213 * changes spaces to tabs to pass travis * removes whitespace on 1740 * adds logging to get_filtered_filelist * fixes travis checks Co-authored-by: bwmarkle <bradm@inmotionhosting.com>
1 parent fc2b904 commit e7611ac

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

admin/class-boldgrid-backup-admin-core.php

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,46 +1485,63 @@ function ( $a, $b ) {
14851485
public function get_filtered_filelist( $dirpath = ABSPATH ) {
14861486

14871487
// Validate input.
1488+
$this->logger->add( 'before validate input' );
14881489
if ( empty( $dirpath ) || ! $this->wp_filesystem->is_readable( $dirpath ) ) {
14891490
return [];
14901491
}
1491-
1492+
$this->logger->add( 'after validate input' );
14921493
// Get the recursive directory listing for the specified path.
1494+
$this->logger->add( 'before recursive directory listing' );
14931495
$filelist = $this->get_filelist( $dirpath );
1494-
1496+
$this->logger->add( 'after recursive directory listing' );
14951497
// If no files were found, then return an empty array.
1498+
$this->logger->add( 'before empty file array' );
14961499
if ( empty( $filelist ) ) {
14971500
return [];
14981501
}
1502+
$this->logger->add( 'after empty file array' );
14991503

15001504
// Initialize $new_filelist.
1505+
$this->logger->add( 'before $new_filelist initialize' );
15011506
$new_filelist = [];
1502-
1507+
$this->logger->add( 'after $new_filelist initialize' );
15031508
// Filter the filelist array.
1509+
$this->logger->add( 'before filter filelist array' );
15041510
foreach ( $filelist as $fileinfo ) {
15051511

15061512
// @todo The user needs a way to specifiy what to skip in the backups.
1507-
$is_node_modules = false !== strpos( $fileinfo[1], '/node_modules/' );
1513+
$this->logger->add( 'before $is_node_modules variable' );
1514+
$is_node_modules = false !== strpos( $fileinfo[1], '/node_modules/' );
1515+
$this->logger->add( 'after $is_node_modules variable' );
1516+
$this->logger->add( 'before $is_backup_directory variable' );
15081517
$is_backup_directory = $this->backup_dir->file_in_dir( $fileinfo[1] );
1509-
1518+
$this->logger->add( 'after $is_backup_directory variable' );
1519+
$this->logger->add( 'before $is_node_modules $is_backup_directory check' );
15101520
if ( $is_node_modules || $is_backup_directory ) {
15111521
continue;
15121522
}
1513-
1523+
$this->logger->add( 'after $is_node_modules $is_backup_directory check' );
1524+
$this->logger->add( 'before folder exclusion check' );
15141525
if ( ! $this->folder_exclusion->allow_file( $fileinfo[1] ) ) {
15151526
continue;
15161527
}
1517-
1528+
$this->logger->add( 'after folder exclusion check' );
1529+
$this->logger->add( 'before $fileinfo set to $new_filelist' );
15181530
$new_filelist[] = $fileinfo;
1531+
$this->logger->add( 'after $fileinfo set to $new_filelist' );
15191532
}
1520-
1533+
$this->logger->add( 'after filter filelist array' );
15211534
// Replace filelist.
1535+
$this->logger->add( 'before replace filelist' );
15221536
$filelist = $new_filelist;
1523-
1537+
$this->logger->add( 'after replace filelist' );
15241538
// Clear filelist_basedir.
1539+
$this->logger->add( 'before filelist basedir null' );
15251540
$this->filelist_basedir = null;
1541+
$this->logger->add( 'after filelist basedir null' );
15261542

15271543
// Return the filelist array.
1544+
$this->logger->add( 'return $filelist' );
15281545
return $filelist;
15291546
}
15301547

0 commit comments

Comments
 (0)