PHPackages                             7d-digital/temporary-file - 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. 7d-digital/temporary-file

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

7d-digital/temporary-file
=========================

Class to create temporary file objects from other files, streams and string contents

093PHPCI failing

Since Jun 28Pushed 5y ago5 watchersCompare

[ Source](https://github.com/7d-digital/temporary-file)[ Packagist](https://packagist.org/packages/7d-digital/temporary-file)[ RSS](/packages/7d-digital-temporary-file/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (3)Used By (0)

[![Build Status](https://camo.githubusercontent.com/6480ed33774c2fd5165abad6879e039eec4fd2a82570530ba405262883cc914c/687474703a2f2f37642d6469676974616c2e636f2e756b2f696d616765732f7374727563747572652f6c6f676f2e737667)](https://7d-digital.co.uk)

temporary-file
==============

[](#temporary-file)

Class for being able to instantiate temporary files for manipulation based on SplFileInfo

Requirements
------------

[](#requirements)

TemporaryFile makes use of the following:

- PHP 7.1

Usage
-----

[](#usage)

Create a temporary file using path to existing file (file is copied)

```
$temporaryFile = \SevenD\TemporaryFile::createFromPath('file.txt');

```

Create a temporary file using string content

```
$temporaryFile = \SevenD\TemporaryFile::createFromContents('This is file contents', 'txt');

```

Create a temporary file using a file resource (file is copied)

```
$fh = fopen('file.txt', 'r+');
$temporaryFile = \SevenD\TemporaryFile::createFromResource($fh, 'txt');

```

Create a temporary file from a valid SplFileObject (file is copied)

```
$splFileObject = new \SplFileObject('file.txt');
$temporaryFile = \SevenD\TemporaryFile::createFromSplFileObject($splFileObject);

```

Set the persist mode for the temporary file

```
$temporaryFile->persistUntil(\SevenD\TemporaryFile::PERSIST_UNTIL_DESTRUCT); // Temporary file is removed from the filesystem when the TemporaryFile object destructs [Default behaviour]
$temporaryFile->persistUntil(\SevenD\TemporaryFile::PERSIST_UNTIL_SHUTDOWN); // Temporary file is removed from the filesystem when the script execution ends and the shutdown functions are run

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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.

### Community

Maintainers

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

---

Top Contributors

[![DanWithams7d](https://avatars.githubusercontent.com/u/18004065?v=4)](https://github.com/DanWithams7d "DanWithams7d (16 commits)")[![russellgalpin](https://avatars.githubusercontent.com/u/1466187?v=4)](https://github.com/russellgalpin "russellgalpin (3 commits)")[![stickler-ci](https://avatars.githubusercontent.com/u/16011037?v=4)](https://github.com/stickler-ci "stickler-ci (1 commits)")

### Embed Badge

![Health badge](/badges/7d-digital-temporary-file/health.svg)

```
[![Health](https://phpackages.com/badges/7d-digital-temporary-file/health.svg)](https://phpackages.com/packages/7d-digital-temporary-file)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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