PHPackages                             salamek/nette-tempnam - 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. salamek/nette-tempnam

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

salamek/nette-tempnam
=====================

This is a simple tempnam extension for Nette Framework

1.1.4(4y ago)0173LGPL-3.0PHP

Since Jul 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Salamek/nette-tempnam)[ Packagist](https://packagist.org/packages/salamek/nette-tempnam)[ RSS](/packages/salamek-nette-tempnam/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (12)Used By (0)

Nette tempnam
=============

[](#nette-tempnam)

This is a simple tempnam extension for [Nette Framework](http://nette.org/)It creates temp files in %tempDir%/tempnam

Why ?
-----

[](#why-)

Sometines you just need to create tempfile such as PDF, Latte templates etc... and you dont want to put them into `sys_get_temp_dir()` (/tmp) and keep them in your Nette project %tempDir%... or just acces same temp file multiple times

Instalation
-----------

[](#instalation)

The best way to install salamek/nette-tempnam is using [Composer](http://getcomposer.org/):

```
$ composer require salamek/nette-tempnam:@dev
```

Then you have to register extension in `config.neon`.

```
extensions:
    tempnam: Salamek\Tempnam\DI\TempnamExtension
```

If you wish to change tempnam path just add this to your config:

```
tempnam:
   tempDir: %tempDir%/tempnam
```

Usage example
-------------

[](#usage-example)

```
/** @var Salamek\Tempnam\Tempnam @inject */
public $tempnam;

$key = 'my_tempnam_key_1'; // Lets say ID of record in database
$data = 'My File COntent'; // Lets say record from database we want as file
$updatedAt = new \DateTime('YYYY-mm-dd'); // Lets say updatedAt column from database to expire tempnam file when record in database is changed

// Load temFile Path or null
$tempFile = $this->tempnam->load($key, $updatedAt);

if ($tempFile === null)
{
    $tempFile = $this->tempnam->save($key, $data, $updatedAt);
}

echo file_get_contents($tempFile); // My File COntent
```

Methods
-------

[](#methods)

```
$this->tempnam->getTempDir(); //Returns tempDir
$this->tempnam->remove($key); //Removes tempnam file by its $key
$this->tempnam->load($key, \DateTimeInterface $updatedAt = null); //Returns tempnam file path by its key if updatedAt matches or returns null
$this->tempnam->save($key, $data, \DateTimeInterface $updatedAt = null) //Saves tempnam file by $key with $data content, returns tempnam path
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

Established project with proven stability

 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 ~168 days

Recently: every ~0 days

Total

11

Last Release

1527d ago

### Community

Maintainers

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

---

Top Contributors

[![Salamek](https://avatars.githubusercontent.com/u/1226241?v=4)](https://github.com/Salamek "Salamek (25 commits)")

---

Tags

nettetemporarynettetempnam

### Embed Badge

![Health badge](/badges/salamek-nette-tempnam/health.svg)

```
[![Health](https://phpackages.com/badges/salamek-nette-tempnam/health.svg)](https://phpackages.com/packages/salamek-nette-tempnam)
```

###  Alternatives

[nette/code-checker

✅ Nette CodeChecker: A simple tool to check source code against a set of Nette coding standards.

881.7M6](/packages/nette-code-checker)[contributte/di

Extra contrib to nette/di

465.8M18](/packages/contributte-di)[contributte/event-dispatcher

Best event dispatcher / event manager / event emitter for Nette Framework

292.4M19](/packages/contributte-event-dispatcher)[contributte/menu-control

Menu control for Nette framework

29108.6k1](/packages/contributte-menu-control)[carrooi/nette-menu

Menu control for Nette framework

2950.0k1](/packages/carrooi-nette-menu)[bileto/cronner

Simple tool which helps with maintenance of cron tasks.

752.1k](/packages/bileto-cronner)

PHPackages © 2026

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