pekkis / temporary-file-manager
临时文件管理器
v2.0.1
2018-08-17 09:59 UTC
Requires
- php: >=7.1
- symfony/filesystem: ~3.4|~4.0
Requires (Dev)
- phpunit/phpunit: ~7.3
This package is not auto-updated.
Last update: 2024-09-14 18:20:57 UTC
README
应用程序临时文件的管理器。按请求删除。
快速开始
状态
完全维护模式。如果你想维护,请呼叫我。
<?php use Pekkis\TemporaryFileManager\TemporaryFileManager; $fm = new TemporaryFileManager($someDirectoryPath); // Add some bytes $ret = $fm->add($someContent); // or add a file and it gets copied $ret2 = $fm->addFile($someFilePath); // Either way, you get a path to the temporary file var_dump($ret); // And when all the manager references are destroyed, typically at the end of a request, the files are deleted too. unset($fm);