denisyukphp / tmpfile-manager
Temp file manager.
5.0.5
2026-09-22 13:03 UTC
Requires
- php: ^8.0
- denisyukphp/tmpfile: ^3.0
- psr/event-dispatcher: ^1.0
- symfony/event-dispatcher: ^5.4 || ^6.4 || ^7.4 || ^8.1
- symfony/filesystem: ^5.4 || ^6.4 || ^7.4 || ^8.1
- symfony/finder: ^5.4 || ^6.4 || ^7.4 || ^8.1
- symfony/process: ^5.4 || ^6.4 || ^7.4 || ^8.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.95
- php-parallel-lint/php-console-highlighter: ^1.0
- php-parallel-lint/php-parallel-lint: ^1.4
- phpunit/phpunit: ^9.6
- psalm/plugin-phpunit: ^0.19
- rector/rector: ^2.6
- vimeo/psalm: ^5.26 || ^6.18
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Temp file manager.
Installation
You can install the latest version via Composer:
composer require denisyukphp/tmpfile-manager
This package requires PHP 8.0 or later.
Quick usage
Build a temp file manager and create a temp file:
<?php use TmpFileManager\TmpFileManagerBuilder; use TmpFile\TmpFileInterface; $tmpFileManager = (new TmpFileManagerBuilder()) ->withTmpFileDir(sys_get_temp_dir()) ->withTmpFilePrefix('php') ->build() ; /** @var TmpFileInterface $tmpFile */ $tmpFile = $tmpFileManager->create();
All temp files created the manager will be purged automatically by default.
Documentation
- Default configuration
- Creating temp files
- Loading temp files
- Removing temp files
- Auto-purging
- Check unclosed resources
- Garbage collection
- Lifecycle events
Read more about temp file on Habr.