jstewmc / read-file
Read a file
Installs: 81
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/jstewmc/read-file
Requires
- php: ^7.0
Requires (Dev)
- jstewmc/test-case: ^1.0
- mikey179/vfsstream: ^1.6
This package is auto-updated.
Last update: 2025-09-29 01:37:56 UTC
README
Read a file.
use Jstewmc\ReadFile\Read; file_put_contents('/path/to/foo.txt', 'foo'); (new Read())('/path/to/foo.txt'); // returns 'foo'
This library is a very simple read file service (see jstewmc/write-file for a simple write file service).
This library wraps PHP's native file_get_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 it!
Author
License
Version
0.1.0, August 31, 2016
- Initial release