pekkis/temporary-file-manager

Temporary file manager

Installs: 74 813

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 2

Open Issues: 0

pkg:composer/pekkis/temporary-file-manager

v2.0.1 2018-08-17 09:59 UTC

This package is not auto-updated.

Last update: 2025-10-12 00:09:45 UTC


README

A manager for application's temporary files. Deletes per-request.

Quickstart

Status

Full maintenance mode. If you want to maintain, holler.

<?php

use Pekkis\TemporaryFileManager\TemporaryFileManager;

$fm = new TemporaryFileManager($someDirectoryPath);

// Add some bytes
$ret = $fm->add($someContent);

// or add a file and it gets copied
$ret2 = $fm->addFile($someFilePath);

// Either way, you get a path to the temporary file
var_dump($ret);

// And when all the manager references are destroyed, typically at the end of a request, the files are deleted too.
unset($fm);