neutron/temporary-filesystem
最新稳定版本:3.0.1
Composer 安装命令:
composer require neutron/temporary-filesystem
包简介
Symfony filesystem extension to handle temporary files
README 文档
README
TemporaryFilesystem propose an API for temprary filesystem based on Symfony Filesystem Component.
Usage
use Neutron\TemporaryFilesystem\TemporaryFilesystem; $fs = TemporaryFilesystem::create();
API Examples :
CreateTemporaryDirectory
CreateTemporaryDirectory creates a temporary directory with an optional mode :
$tempDir = $fs->createTemporaryDirectory($mode = 0755);
CreateTemporaryFile
CreateTemporaryFile creates an empty files in the temporary folder:
$fs->createTemporaryFile(); // return an empty temporary files with a "thumb-" // prefix, '.dcm' as suffix and 'jpg' as extension $fs->createTemporaryFile('thumb-', '.dcm', 'jpg');
CreateTemporaryFiles
CreateTemporaryFiles creates a set of empty files in the temporary folder:
// return an array of 5 path to temporary files $fs->createTemporaryFiles(5); // return an array of 5 path to empty temporary files with a "thumb-" // prefix, '.dcm' as suffix and 'jpg' as extension $fs->createTemporaryFiles(20, 'thumb-', '.dcm', 'jpg');
This method is useful when dealing with libraries which encode images depending on the filename extension.
CreateEmptyFile
CreateEmptyFile creates an empty file in the specified folder:
// return a path to an empty file inside the current working directory $fs->createEmptyFile(getcwd()); // return a path to an empty file in the "/home/romain" directory. The file // has "original." as prefix, ".raw" as suffix and "CR2" as extension. $fs->createEmptyFile("/home/romain", 'original.', '.raw', 'CR2');
This method is particularly useful when dealing with concurrent process writing in the same directory.
License
Released under the MIT license
统计信息
- 总下载量: 10.59M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 121
- 点击次数: 1
- 依赖项目数: 31
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04