PHPackages                             keboola/php-temp - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. keboola/php-temp

ActiveLibrary[File &amp; Storage](/categories/file-storage)

keboola/php-temp
================

Temp library handles application temporary files

2.0.1(7y ago)0418.7k↓49.9%120MITPHPPHP &gt;=7.1

Since Sep 30Pushed 3y ago16 watchersCompare

[ Source](https://github.com/keboola/php-temp)[ Packagist](https://packagist.org/packages/keboola/php-temp)[ RSS](/packages/keboola-php-temp/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (6)Versions (11)Used By (20)

Temp Library [![Build Status](https://camo.githubusercontent.com/2b00acad9628a785c7a18fbb8fe8f8a445eb28c19cb523dd0976a543d1548a5d/68747470733a2f2f7472617669732d63692e6f72672f6b65626f6f6c612f7068702d74656d702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/keboola/php-temp) [![Maintainability](https://camo.githubusercontent.com/ce3a7a28ca20874afc610c0d80213dfbf663e30db5ae34519257c724e4eecf7f/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31663061393632323763376536343833343637642f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/keboola/php-temp/maintainability) [![Test Coverage](https://camo.githubusercontent.com/5744ddd389bbad20aafbcfe23a947b68b0ef788041984395c0c46a3db13ef36d/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31663061393632323763376536343833343637642f746573745f636f766572616765)](https://codeclimate.com/github/keboola/php-temp/test_coverage)
====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#temp-library---)

This library provides an isolated temporary folder for an application. The library has methods for generating randomly named folders and files.

Usage
-----

[](#usage)

```
use Keboola\Temp\Temp;
$temp = new Temp('prefix');
// Creates a file with unique name suffixed by 'suffix'
$tempFile = $temp->createTmpFile('suffix');
echo 'Files are stored in: ' . $temp->getTmpFolder();
$temp->remove();
```

Available methods:

- `getTmpFolder` -- Get the name of the temporary folder.
- `createFile` -- Create a named file in the temporary folder.
- `createTmpFile` -- Create a random file in the temporary folder.

Migration from version 1.0
--------------------------

[](#migration-from-version-10)

- The temp folder is no longer deleted automatically in the destructor. It needs to be removed explicitly by calling the `remove()` method.
- The public `setId` method was removed. This function was rarely used and is no longer available.
- The public `initRunFolder` method was removed. The folder is now initialized when used and there is no need to call `initRunFolder` any more.
- The protected `getTmpPath` method is now private.

License
-------

[](#license)

MIT licensed, see [LICENSE](./LICENSE) file.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community29

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 65.6% 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 ~185 days

Recently: every ~287 days

Total

10

Last Release

2625d ago

Major Versions

0.1.6 → 1.0.02017-11-13

1.0.0 → 2.0.02019-02-18

PHP version history (2 changes)0.1.0PHP &gt;=5.3.3

2.0.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/101dbf2551a0709ddab522f97669f13a2c4cc2d0a1e8d009f3af6ba80accb1a9?d=identicon)[Keboola](/maintainers/Keboola)

---

Top Contributors

[![odinuv](https://avatars.githubusercontent.com/u/4319320?v=4)](https://github.com/odinuv "odinuv (21 commits)")[![ondrejhlavacek](https://avatars.githubusercontent.com/u/497675?v=4)](https://github.com/ondrejhlavacek "ondrejhlavacek (8 commits)")[![MiroCillik](https://avatars.githubusercontent.com/u/1488015?v=4)](https://github.com/MiroCillik "MiroCillik (2 commits)")[![ujovlado](https://avatars.githubusercontent.com/u/419849?v=4)](https://github.com/ujovlado "ujovlado (1 commits)")

---

Tags

filesystemtemp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/keboola-php-temp/health.svg)

```
[![Health](https://phpackages.com/badges/keboola-php-temp/health.svg)](https://phpackages.com/packages/keboola-php-temp)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[toteph42/identity_switch

This plugin allows users to switch between different identities (and check for new mails) in a single Roundcube session.

221.5k](/packages/toteph42-identity-switch)[icecave/temptation

Painless temporary files and directories that clean up after themselves.

129.4k2](/packages/icecave-temptation)

PHPackages © 2026

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