denisyukphp / tmpfile

Alternative to tmpfile() function.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TmpFile

Build Status Latest Stable Version Packagist PHP Version Support Total Downloads License

Alternative to tmpfile() function.

Installation

You can install the latest version via Composer:

composer require denisyukphp/tmpfile

This package requires PHP 8.0 or later.

Quick usage

A temp file will be removed after PHP finished:

<?php

use TmpFile\TmpFile;

$tmpFile = new TmpFile();

file_put_contents($tmpFile, 'Meow!');

rename($tmpFile, '/path/to/meow.txt');

Read more about temp file on Habr.

About

Alternative to tmpfile() function.

License:MIT License


Languages

Language:PHP 85.5%Language:Dockerfile 8.7%Language:Makefile 5.8%