Skip to content

Commit 55290fa

Browse files
committed
feature #7345 Documented the appendToFile() method (javiereguiluz)
This PR was squashed before being merged into the master branch (closes #7345). Discussion ---------- Documented the appendToFile() method This fixes #7341. Commits ------- 675ee7f Documented the appendToFile() method
2 parents 6790971 + 675ee7f commit 55290fa

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

components/filesystem.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,20 @@ complete new file (but never a partially-written file)::
283283

284284
The ``file.txt`` file contains ``Hello World`` now.
285285

286+
appendToFile
287+
~~~~~~~~~~~~
288+
289+
.. versionadded:: 3.3
290+
The :method:`Symfony\\Component\\Filesystem\\Filesystem::appendToFile` method was introduced in Symfony 3.3.
291+
292+
:method:`Symfony\\Component\\Filesystem\\Filesystem::appendToFile` adds new
293+
contents at the end of some file::
294+
295+
$fs->appendToFile('logs.txt', 'Email sent to user@example.com');
296+
297+
If either the file or its containing directory doesn't exist, this method
298+
creates them before appending the contents.
299+
286300
Error Handling
287301
--------------
288302

0 commit comments

Comments
 (0)