Skip to content

Commit 37e5229

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: Add a note to explain the goal of the followLinks method
2 parents aa970e3 + d5c455e commit 37e5229

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

components/finder.rst

+24
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,30 @@ If you want to follow `symbolic links`_, use the ``followLinks()`` method::
127127

128128
$finder->files()->followLinks();
129129

130+
Note that this method follows links but it doesn't resolve them. Consider
131+
the following structure of files of directories:
132+
133+
.. code-block:: text
134+
135+
├── folder1/
136+
│ ├──file1.txt
137+
│ ├── file2link (symbolic link to folder2/file2.txt file)
138+
│ └── folder3link (symbolic link to folder3/ directory)
139+
├── folder2/
140+
│ └── file2.txt
141+
└── folder3/
142+
└── file3.txt
143+
144+
If you try to find all files in ``folder1/`` via ``$finder->files()->in('/path/to/folder1/')``
145+
you'll get the following results:
146+
147+
* When **not** using the ``followLinks()`` method: ``file1.txt`` and ``file2link``
148+
(this link is not resolved). The ``folder3link`` doesn't appear in the results
149+
because it's not followed or resolved;
150+
* When using the ``followLinks()`` method: ``file1.txt``, ``file2link`` (this link
151+
is still not resolved) and ``folder3/file3.txt`` (this file appears in the results
152+
because the ``folder1/folder3link`` link was followed).
153+
130154
Version Control Files
131155
~~~~~~~~~~~~~~~~~~~~~
132156

0 commit comments

Comments
 (0)