Skip to content

Commit 51d9c17

Browse files
committed
[Filesystem] Add docs for Filesystem::mirror() options
1 parent 928fdf9 commit 51d9c17

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
@@ -255,7 +255,17 @@ contents of the source directory into the target one (use the
255255
:method:`Symfony\\Component\\Filesystem\\Filesystem::copy` method to copy single
256256
files)::
257257

258+
// mirror a directory
258259
$filesystem->mirror('/path/to/source', '/path/to/target');
260+
// mirror with any options
261+
$filesystem->mirror('/path/to/source', '/path/to/target', null, $options);
262+
263+
The following options can be passed:
264+
265+
* ``override`` (default: ``false``): If true, target files newer than origin files are overwritten (see :method:`Symfony\\Component\\Filesystem\\Filesystem::copy`)
266+
* ``copy_on_windows`` (default: ``false``): Whether to copy files instead of links on Windows. Since symfony/filesystem 6.4 this option is deprecated, use follow_symlinks instead.
267+
* ``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.
268+
* ``delete`` (default: ``false``): Whether to delete files that are not in the source directory.
259269

260270
``isAbsolutePath``
261271
~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy