Skip to content

Commit 6c23a76

Browse files
committed
minor #16078 [Filesystem] Add third argument $lock to Filesystem::appendToFile (zairigimad)
This PR was submitted for the 5.3 branch but it was merged into the 5.4 branch instead. Discussion ---------- [Filesystem] Add third argument $lock to `Filesystem::appendToFile` related issue #16028 Commits ------- 78e6f65 Update filesystem.rst
2 parents 1a5f2fe + 78e6f65 commit 6c23a76

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

components/filesystem.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,16 @@ The ``file.txt`` file contains ``Hello World`` now.
311311
contents at the end of some file::
312312

313313
$filesystem->appendToFile('logs.txt', 'Email sent to [email protected]');
314+
// with the third argument set to true you can lock the file when writing to it.
315+
$filesystem->appendToFile('logs.txt', 'Email sent to [email protected]', true);
314316

315317
If either the file or its containing directory doesn't exist, this method
316318
creates them before appending the contents.
317319

320+
.. versionadded:: 5.4
321+
322+
The third argument ``$lock`` was introduced in Symfony 5.4.
323+
318324
Error Handling
319325
--------------
320326

0 commit comments

Comments
 (0)