axy / fs-ifs
Abstraction of file system functions
0.0.4
2017-05-11 14:12 UTC
Requires
- php: >=5.4.0
This package is auto-updated.
Last update: 2024-11-08 02:22:38 UTC
README
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.
Documentation
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.
Implementations
This package defines only interfaces. Specific implementations are located in other packages. For example, work with real FS is axy/fs-real.