sndsgd / fs
PHP的文件系统工具包
0.4.5
2017-11-04 15:37 UTC
Requires
- php: >=7.0.0
- sndsgd/util: >=1.1.0
Requires (Dev)
- mikey179/vfsstream: 1.6.4
- php-mock/php-mock-phpunit: ^1.1
- phpunit/phpunit: ~5
- satooshi/php-coveralls: ~1.0
README
PHP的文件系统工具包。
为什么?
sndsgd\fs
中的类试图简化繁琐的文件系统任务。
use \sndsgd\Fs; # lets assume `/tmp/some` doesn't exist $path = "/tmp/some/deep/path/file.txt"; # write to a file that doesn't exist in a directory that doesn't exist $file = Fs::getFile($path); if ($file->write("the contents...") === false) { throw new Exception($file->getError()); }
要求
该项目是不稳定的,版本之间可能会有变化。如果您打算依赖此项目,请务必在项目中的composer.json
文件中注明并指定版本。这样做将确保任何破坏性的更改不会破坏您的项目。
使用此库需要PHP >= 7.0.0。
安装
使用Composer安装sndsgd/fs
。
composer require sndsgd/fs