Skip to content
Painless temporary files and directories that clean up after themselves.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test/suite
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
composer.json
composer.lock
phpunit.xml

README.md

Temptation

Build Status Code Coverage Latest Version

Temptation is a simple PHP library for creating temporary files and directories that clean up after themselves.

composer require icecave/temptation

Example

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.
You can’t perform that action at this time.