定制 keboola/php-temp 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

keboola/php-temp

最新稳定版本:2.0.1

Composer 安装命令:

composer require keboola/php-temp

包简介

Temp library handles application temporary files

README 文档

README

This library provides an isolated temporary folder for an application. The library has methods for generating randomly named folders and files.

Usage

use Keboola\Temp\Temp;
$temp = new Temp('prefix');
// Creates a file with unique name suffixed by 'suffix'
$tempFile = $temp->createTmpFile('suffix');
echo 'Files are stored in: ' . $temp->getTmpFolder();
$temp->remove();

Available methods:

  • getTmpFolder -- Get the name of the temporary folder.
  • createFile -- Create a named file in the temporary folder.
  • createTmpFile -- Create a random file in the temporary folder.

Migration from version 1.0

  • The temp folder is no longer deleted automatically in the destructor. It needs to be removed explicitly by calling the remove() method.
  • The public setId method was removed. This function was rarely used and is no longer available.
  • The public initRunFolder method was removed. The folder is now initialized when used and there is no need to call initRunFolder any more.
  • The protected getTmpPath method is now private.

License

MIT licensed, see LICENSE file.

统计信息

  • 总下载量: 388.02k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 31
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 17
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-09-30