You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug delete_files() in the Filesystem Helper currently ignores hidden directories. I'm not sure if this is a "bug" since the code seems to do it deliberately (notice the first line):
But this isn't documented anywhere and seems an odd exclusion. For example, cleaning up an example project delete_files() fails to remove the root directory because it contains .github/.
If leaving hidden directories is intentional, then I would be in favor of giving this the same treatment as get_filenames(): remove the recursive call, use a RecursiveIteratorIterator instead, and add a parameter for bool $hidden = false.
CodeIgniter 4 version develop
Affected module(s)
Helpers > Filesystem
Expected behavior, and steps to reproduce if appropriate
Given:
ROOT/app/[files]
ROOT/writable/[files]
ROOT/.github/[files]
I would expect calling delete_files('ROOT', true) to wipe the whole project, but it does not.
Context
OS: Linux
Web server: Apache
PHP version: 7.3
The text was updated successfully, but these errors were encountered:
MGatner
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
May 19, 2020
Describe the bug
delete_files()
in the Filesystem Helper currently ignores hidden directories. I'm not sure if this is a "bug" since the code seems to do it deliberately (notice the first line):But this isn't documented anywhere and seems an odd exclusion. For example, cleaning up an example project
delete_files()
fails to remove the root directory because it contains .github/.If leaving hidden directories is intentional, then I would be in favor of giving this the same treatment as
get_filenames()
: remove the recursive call, use aRecursiveIteratorIterator
instead, and add a parameter forbool $hidden = false
.CodeIgniter 4 version
develop
Affected module(s)
Helpers > Filesystem
Expected behavior, and steps to reproduce if appropriate
Given:
ROOT/app/[files]
ROOT/writable/[files]
ROOT/.github/[files]
I would expect calling
delete_files('ROOT', true)
to wipe the whole project, but it does not.Context
The text was updated successfully, but these errors were encountered: