feature #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
-------
1f7b753670
[Filesystem] Add appendToFile()
This commit is contained in:
commit
efe2a93bba
@ -1,6 +1,11 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
3.3.0
|
||||
-----
|
||||
|
||||
* added `appendToFile()` to append contents to existing files
|
||||
|
||||
3.2.0
|
||||
-----
|
||||
|
||||
|
Reference in New Issue
Block a user