PHPackages                             danbettles/temper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. danbettles/temper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

danbettles/temper
=================

Tame your temp-files. Temper offers a smoother approach to working with temp-files in PHP.

v3.0.0(1y ago)0169—0%ISCPHPPHP ^8.1.28

Since Nov 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/danbettles/temper)[ Packagist](https://packagist.org/packages/danbettles/temper)[ RSS](/packages/danbettles-temper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

Temper
======

[](#temper)

Temper offers a smoother approach to working with temp-files in PHP.

Usage
-----

[](#usage)

There are two ways to use it:

- 'Consume' a temp-file: create, use, and remove a temp-file in a single operation
- Create and remove temp-files in separate steps

### Consume a Temp-File

[](#consume-a-temp-file)

```
$temper = new Temper('/path/to/tmp/dir');

$temper->consumeFile(function (SplFileInfo $tempFileinfo): void {
    // Do something with temp-file
});

// Temp-file gone

$temper->consumeFile(function (SplFileInfo $tempFileinfo): void {
    // Do something with `.jpg` temp-file
}, 'jpg');

// Temp-file gone
```

### Create and Remove In Separate Steps

[](#create-and-remove-in-separate-steps)

Note

Since, at the end of its life, a Temper instance will automatically clean-up any remaining temp-files it knows about, you may never *need* to call `cleanUp()` by hand

```
$temper = new Temper('/path/to/tmp/dir');

$tempFileWithoutExtension = $temper->createFile();

$tempImageFile = $temper->createFile('jpg');

// Removes *all* remaining temp-files created by the Temper instance
$temper->cleanUp();
```

Installation
------------

[](#installation)

Install using [Composer](https://getcomposer.org/):

```
composer require danbettles/temper
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~213 days

Total

4

Last Release

647d ago

Major Versions

v1.0.0 → v2.0.02024-05-18

v2.1.0 → v3.0.02024-08-10

PHP version history (2 changes)v1.0.0PHP ^7.4|^8.1.3

v2.0.0PHP ^8.1.28

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb4422c02b29b1ae4a4746abb1ebf16c0216d5fc62cf0604e7c6aa4de974b39b?d=identicon)[danbettles](/maintainers/danbettles)

---

Top Contributors

[![danbettles](https://avatars.githubusercontent.com/u/736672?v=4)](https://github.com/danbettles "danbettles (5 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/danbettles-temper/health.svg)

```
[![Health](https://phpackages.com/badges/danbettles-temper/health.svg)](https://phpackages.com/packages/danbettles-temper)
```

###  Alternatives

[dem13n/discussion-cards

Output of discussions in form of cards

164.6k](/packages/dem13n-discussion-cards)[tureki/phpcc

A PHP Library to use Google Closure Compiler compress Javascript

202.7k](/packages/tureki-phpcc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
