kohkimakimoto / temporary
用于操作临时文件的PHP辅助类。
v1.0.1
2015-07-29 04:03 UTC
Requires
- php: >=5.3.0
Requires (Dev)
- fabpot/php-cs-fixer: @stable
- phpunit/phpunit: 4.*
This package is auto-updated.
Last update: 2024-09-07 00:17:26 UTC
README
用于操作临时文件和目录的PHP辅助类。
临时文件。
use Kohkimakimoto\Temporary\TemporaryFile; $tmpfile = new TemporaryFile(); echo $tmpfile->path(); // ex) /private/var/folders/bt/xwh9qmcj00dctz53_rxclgtr0000gn/T/phpqWK5fj $tmpfile->write("temporary data..."); echo $data = $tmpfile->read(); // temporary data... // You don't need to close it. The temporary file will be closed automatically when the object removes.
临时目录。
use Kohkimakimoto\Temporary\TemporaryDir; $tmpdir = new TemporaryDir(); echo $tmpdir->path(); // ex) /private/var/folders/bt/xwh9qmcj00dctz53_rxclgtr0000gn/T/KFHg4L // You don't need to close it. The temporary dir will be deleted automatically when the object removes.
要求
- PHP5.3或更高版本
安装
创建composer.json
文件以通过composer安装。
{
"require": {
"kohkimakimoto/temporary": "1.0.*"
}
}
运行composer install命令。
composer install
作者
Kohki Makimoto kohki.makimoto@gmail.com
许可证
MIT许可证。