Abstraction of file system functions (PHP).
- The library does not require any dependencies.
- Tested on PHP 5.4+, PHP 7, HHVM (on Linux), PHP 5.5 (on Windows).
- Install:
composer require axy/fs-ifs
. - License: MIT.
The library reproduces built-in file system functions.
Differences:
- The application code to access files not via global functions, and via an object with a particular interface. This object is easily replaced by another implementation. Can use a mock for tests (it does not work with real file system, but with memory).
- Exceptions instead of WARNINGs.
- Separate class for work with opened file.
- Several results are structured as objects (Stat, MetaData) instead associative arrays. It improves the autocomplete.
- Method names are better structured.
- Specific implementations can implement additional features. Log, an isolated directory and etc.
This package defines only interfaces. Specific implementations are located in other packages. For example, work with real FS is axy/fs-real.