PHPackages                             flavioheleno/interim - 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. flavioheleno/interim

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

flavioheleno/interim
====================

An open\_basedir aware wrapper for tmpfile() and sys\_get\_temp\_dir()

v0.1.0(3y ago)0178MITPHPPHP ^8.2

Since Mar 27Pushed 3y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Interim
=======

[](#interim)

Interim is a simple wrapper around PHP's `tmpfile()` and `sys_get_temp_dir()` that takes into account open basedir restriction.

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

[](#installation)

To use Interim, simple run:

```
composer require flavioheleno/interim
```

Usage
-----

[](#usage)

When `open_basedir` is disabled, Interim behaves exactly the same way as `sys_get_temp_dir()`:

```
// before
var_dump(sys_get_temp_dir());
// string(4) "/tmp"

// after
var_dump(Interim\Temporary::getDirectory());
// string(4) "/tmp"

// -or-
var_dump(Interim\Temporary::getDirectory('tmp'));
// string(4) "/tmp"

// -or-
var_dump(Interim\Temporary::getDirectory('/var/tmp'));
// string(4) "/tmp"
```

When `open_basedir` is enabled, Interim will check if temporary dir is in the open\_basedir list, if not, it will return an alternative.

```
ini_set('open_basedir', '/var/www/html:/var/tmp');

// before (if you try to use "/tmp", an "open_basedir restriction in effect" warning will be raised)
var_dump(sys_get_temp_dir());
// string(4) "/tmp"

// after
var_dump(Interim\Temporary::getDirectory());
// string(4) "/var/www/html"

// -or-
var_dump(Interim\Temporary::getDirectory('tmp'));
// string(4) "/var/www/html/tmp"

// -or-
var_dump(Interim\Temporary::getDirectory('/var/tmp'));
// string(4) "/var/tmp"
```

License
-------

[](#license)

This library is licensed under the [MIT License](LICENSE).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Unknown

Total

1

Last Release

1148d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/42b9c9cbc06973a61587667fc811b853f4d71843f35ba2535f3900083e69ab3f?d=identicon)[flavioheleno](/maintainers/flavioheleno)

---

Top Contributors

[![flavioheleno](https://avatars.githubusercontent.com/u/471860?v=4)](https://github.com/flavioheleno "flavioheleno (1 commits)")

---

Tags

temporary-directorytemporarytemporary filetmptmpfileopen\_basedirsys\_get\_temp\_dir

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/flavioheleno-interim/health.svg)

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

###  Alternatives

[denisyukphp/tmpfile

Alternative to tmpfile() function.

224.2k1](/packages/denisyukphp-tmpfile)[aryehraber/statamic-splash

Browse Unsplash images right from the CP.

125.8k](/packages/aryehraber-statamic-splash)

PHPackages © 2026

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