takuya / php-mktempfile
1.1
2024-03-14 18:10 UTC
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-09-10 16:54:11 UTC
README
在SysTemp中用temp_name创建临时文件并自动删除。
mktempfile函数
此包为您的composer项目提供了一个mktempfile()
函数。
<?php require_once 'vendor/autoload.php'; $temp_file = mktempfile(); file_exists($temp_file);#=>true
$temp_file将会自动删除
$temp_file
将会由 'register_shutdown_function' 自动删除。
系统临时目录
mktempfile()
通过'sys_get_temp_dir()'在系统临时目录创建文件。
从GitHub安装。
composer config repositories.takuya/php-mktempfile vcs https://github.com/takuya/php-mktempfile
composer require takuya/php-mktempfile
通过packagist安装。
composer require takuya/php-mktempfile
composer install
测试结果。
测试
composer install
./vendor/bin/phpunit