Skip to content

Commit faf0807

Browse files
committed
add docs for Filesystem::mirror() options
1 parent b50517d commit faf0807

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

components/filesystem.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,17 @@ contents of the source directory into the target one (use the
258258
:method:`Symfony\\Component\\Filesystem\\Filesystem::copy` method to copy single
259259
files)::
260260

261+
// mirror a directory
261262
$filesystem->mirror('/path/to/source', '/path/to/target');
263+
// mirror with any options
264+
$filesystem->mirror('/path/to/source', '/path/to/target', null, $options);
265+
266+
The following options can be passed:
267+
268+
* override (default false): If true, target files newer than origin files are overwritten (see :method:`Symfony\\Component\\Filesystem\\Filesystem::copy`)
269+
* copy_on_windows (default false): Whether to copy files instead of links on Windows. Since symfony/filesystem 6.2 this option is deprecated, use follow_symlinks instead.
270+
* follow_symlinks (default false): Whether to copy files instead of links, where using symlinks in not working: windows, different drive, docker context not supporting symlinks.
271+
* delete (default false): Whether to delete files that are not in the source directory.
262272

263273
``isAbsolutePath``
264274
~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)