icecave / temptation
Painless temporary files and directories that clean up after themselves.
Installs: 9 234
Dependents: 2
Suggesters: 0
Security: 0
Stars: 10
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=5.3
- icecave/isolator: ~2
- symfony/filesystem: ~2
Requires (Dev)
- icecave/archer: ~1
This package is auto-updated.
Last update: 2024-10-29 04:03:58 UTC
README
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.