Skip to content

Commit

Permalink
preserve directories with full paths
Browse files Browse the repository at this point in the history
  • Loading branch information
wordpressfan committed Jan 28, 2025
1 parent a92c6d5 commit 016917b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions inc/Engine/Common/Cache/FilesystemCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ public function full_clear( array $preserve_dirs = [] ): bool {
if ( ! $this->filesystem->exists( $base_path ) ) {
return false;
}

if ( ! empty( $preserve_dirs ) ) {
$preserve_dirs = array_map( function ( $dir ) use ( $base_path ) {

Check notice on line 120 in inc/Engine/Common/Cache/FilesystemCache.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

inc/Engine/Common/Cache/FilesystemCache.php#L120

Opening parenthesis of a multi-line function call must be the last content on the line
return $base_path . $dir;
}, $preserve_dirs );

Check notice on line 122 in inc/Engine/Common/Cache/FilesystemCache.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

inc/Engine/Common/Cache/FilesystemCache.php#L122

Only one argument is allowed per line in a multi-line function call
}

rocket_rrmdir( $base_path, $preserve_dirs, $this->filesystem );
return true;
}
Expand Down

0 comments on commit 016917b

Please sign in to comment.