icecave/temptation

无需手动清理的临时文件和目录。

1.0.0 2014-09-09 09:12 UTC

This package is auto-updated.

Last update: 2024-08-29 03:26:14 UTC


README

Build Status Code Coverage Latest Version

Temptation 是一个简单的 PHP 库,用于创建会自动清理的临时文件和目录。

composer require icecave/temptation

示例

use Icecave\Temptation\Temptation;

// Use the temptation object to create files and directories ...
$temptation = new Temptation();

// Create a temporary file ...
$file = $temptation->createFile();

// Use the temporary file ...
file_put_contents($file->path(), 'This is my temp file.');

// Don't do anything else!
// The temporary file is automatically deleted when the $file object goes out of scope.