denisyukphp/tmpfile

Alternative to tmpfile() function

2.4.0 2021-06-30 11:18 UTC

This package is auto-updated.

Last update: 2021-12-01 00:17:28 UTC


README

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 7.2 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.