Skip to content

Commit efe2a93

Browse files
committed
feature symfony#20612 [Filesystem] Add appendToFile() (chalasr)
This PR was merged into the 3.3-dev branch. Discussion ---------- [Filesystem] Add appendToFile() | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | todo So we could append content to a file: ```php (new Filesystem)->appendToFile($file, 'bar'); ``` instead of doing it in two steps: ```php if (false === $content = @file_get_contents($file)) { throw new \Exception(); } (new Filesystem)->dumpFile($file, $content.'bar'); ``` Doing it opt-in using `dumpFile(..., $append = false)` would have been enough but not possible for BC. Commits ------- 1f7b753 [Filesystem] Add appendToFile()
2 parents 2ee8626 + 1f7b753 commit efe2a93

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Filesystem/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
3.3.0
5+
-----
6+
7+
* added `appendToFile()` to append contents to existing files
8+
49
3.2.0
510
-----
611

0 commit comments

Comments
 (0)