Skip to content

Bug: Helper function directory_mirror() throws an error if destination directory exists (with overwrite option true) #5478

@dmillard70

Description

@dmillard70

PHP Version

8.0

CodeIgniter4 Version

4.1.5

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

macOS

Which server did you use?

apache

Database

MySql 5.6

What happened?

Helper function directory_mirror() throws an error if destination directory exists (with overwrite option true), because there is no check whether directory already exists (filesystem_helper.php line 94).
I think this should be changed because the name of the function (* mirror *) suggests a function including subdirectories.

Steps to Reproduce

Just call twice directory_mirror() with same source (including subdirectories) and target path with overwrite option true.

Expected Output

Create sub directory only if subdirectory in target does not exist.
Consequently the name (* mirror *) perhaps suggests that you could mirror an path with all elements (including deleting no longer existing elements in destination)

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions