From 29f08196ae943c7aa6f9f93cf57a369f0925ad3c Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 9 Jan 2017 15:19:10 +0100 Subject: [PATCH 1/2] Documented the appendToFile() method --- components/filesystem.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/filesystem.rst b/components/filesystem.rst index 6386fad4bbb..a7d171f706a 100644 --- a/components/filesystem.rst +++ b/components/filesystem.rst @@ -283,6 +283,17 @@ complete new file (but never a partially-written file):: The ``file.txt`` file contains ``Hello World`` now. +appendToFile +~~~~~~~~~~~~ + +:method:`Symfony\\Component\\Filesystem\\Filesystem::appendToFile` adds new +contents at the end of some file:: + + $fs->appendToFile('logs.txt', 'Email sent to user@example.com'); + +If either the file or its containing directory don't exist, this method creates +them before appending the contents. + Error Handling -------------- From 0599df2a8ec529ef7babb5c88c12e314b0752b45 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 12 Jan 2017 08:46:01 +0100 Subject: [PATCH 2/2] Added the versionadded directive --- components/filesystem.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/filesystem.rst b/components/filesystem.rst index a7d171f706a..a1d0ad55a64 100644 --- a/components/filesystem.rst +++ b/components/filesystem.rst @@ -286,13 +286,16 @@ The ``file.txt`` file contains ``Hello World`` now. appendToFile ~~~~~~~~~~~~ +.. versionadded:: 3.3 + The :method:`Symfony\\Component\\Filesystem\\Filesystem::appendToFile` method was introduced in Symfony 3.3. + :method:`Symfony\\Component\\Filesystem\\Filesystem::appendToFile` adds new contents at the end of some file:: $fs->appendToFile('logs.txt', 'Email sent to user@example.com'); -If either the file or its containing directory don't exist, this method creates -them before appending the contents. +If either the file or its containing directory doesn't exist, this method +creates them before appending the contents. Error Handling --------------