denisyukphp / tmpfile-manager
Temp file manager.
5.0.4
2024-11-19 15:58 UTC
Requires
- php: ^8.0
- denisyukphp/tmpfile: ^3.0
- psr/event-dispatcher: ^1.0
- symfony/event-dispatcher: ^6.0
- symfony/filesystem: ^6.0
- symfony/finder: ^6.0
- symfony/process: ^6.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.10
- php-parallel-lint/php-console-highlighter: ^1.0
- php-parallel-lint/php-parallel-lint: ^1.3
- phpunit/phpunit: ^9.5
- psalm/plugin-phpunit: ^0.17.0
- vimeo/psalm: ^4.26
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.