jstewmc / write-file
Write a file
v0.1.0
2016-09-01 02:42 UTC
Requires
- php: ^7.0
Requires (Dev)
- jstewmc/test-case: ^1.0
- mikey179/vfsstream: ^1.6
This package is auto-updated.
Last update: 2024-10-29 04:25:37 UTC
README
Write a file.
use Jstewmc\WriteFile\Write; (new Write())('/path/to/foo.txt', 'foo'); file_get_contents('/path/to/foo.txt'); // returns 'foo'
This library is a very simple write file service (see jstewmc/read-file for a simple read file service).
This library wraps PHP's native file_put_contents()
with a little robust error checking. If the file does not exist, the path is not actually a file, or the file is not readable, an InvalidArgumentException
will be thrown.
That's about it!
Author
License
Version
0.1.0, August 31, 2016
- Initial release