PHPackages                             cicnavi/simple-file-cache-php - 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. [Caching](/categories/caching)
4. /
5. cicnavi/simple-file-cache-php

ActiveLibrary[Caching](/categories/caching)

cicnavi/simple-file-cache-php
=============================

PSR-16 simple cache provider based on files.

v3.0.0(1y ago)12.1k↑168.1%11MITPHPPHP ^8.2CI passing

Since Nov 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/cicnavi/simple-file-cache-php)[ Packagist](https://packagist.org/packages/cicnavi/simple-file-cache-php)[ RSS](/packages/cicnavi-simple-file-cache-php/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (5)Versions (7)Used By (1)

[![Build](https://github.com/cicnavi/simple-file-cache-php/workflows/Build/badge.svg)](https://github.com/cicnavi/simple-file-cache-php/workflows/Build/badge.svg)

cicnavi/simple-file-cache-php
=============================

[](#cicnavisimple-file-cache-php)

[PSR-16](https://www.php-fig.org/psr/psr-16/) simple cache provider based on files.

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

[](#installation)

```
composer require cicnavi/simple-file-cache-php
```

Usage
-----

[](#usage)

Use class Cicnavi\\SimpleFileCache\\SimpleFileCache to instantiate a cache instance. It can accept following arguments:

- $cacheName (optional/recommended, string) - cache name used to separate cache domains, 'simple-file-cache' being default
- $storagePath (optional, string) - path to writable folder which will be used to store cache files. If not provided, default system 'tmp' folder will be used.
- $fileSystemService (optional, Cicnavi\\SimpleFileCache\\Services\\Interfaces\\FileSystemServiceInterface) - FileSystemServiceInterface instance used to communicate with the filesystem (Cicnavi\\SimpleFileCache\\Services\\FileSystemService being default)

Using different cache names is a recommended way of separating cache domains. If you don't specify the cache name, the default will be used. Keep in mind that the PSR-16 includes method clear(), which wipes out the entire cache for a particular domain (particular cache name).

### Example

[](#example)

```
use Cicnavi\SimpleFileCache\SimpleFileCache;

$cache = new SimpleFileCache('some-cache-name', '/some/writable/storage/folder');
// Alternatively, instantiate it using defaults...
// $cache = new SimpleFileCache('some-cache-name'); // Use specific cache name, but use default system 'tmp' folder
// $cache = new SimpleFileCache(); // Use default cache name and default system 'tmp' folder

$somethingImportant = 'This string was fetched from API using HTTP request, which is expensive. I\'ll store it
in cache for later use so I don\'t have to make another HTTP request for the same thing';

// Use any of the PSR-16 metods to work with cache...:
$cache->set('somethingImportant', $somethingImportant);

//... later
$somethingImportant = $cache->get('somethingImportant');
```

Tests
-----

[](#tests)

This will run phpunit, psalm and phpcs:

```
$ composer run-script test
```

Licence
-------

[](#licence)

MIT

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance46

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community10

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

Total

4

Last Release

410d ago

Major Versions

v1.0.0 → v2.0.02021-08-18

v2.0.0 → v3.0.02025-02-07

PHP version history (2 changes)v1.0.0PHP &gt;=7.4

v3.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/26a25e71650f20493572747eabd3c68ab1188536634b6468888296340e2dda14?d=identicon)[cicnavi](/maintainers/cicnavi)

---

Top Contributors

[![cicnavi](https://avatars.githubusercontent.com/u/3176844?v=4)](https://github.com/cicnavi "cicnavi (7 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cicnavi-simple-file-cache-php/health.svg)

```
[![Health](https://phpackages.com/badges/cicnavi-simple-file-cache-php/health.svg)](https://phpackages.com/packages/cicnavi-simple-file-cache-php)
```

###  Alternatives

[cache/adapter-common

Common classes for PSR-6 adapters

11024.1M37](/packages/cache-adapter-common)[cache/cache

Library of all the php-cache adapters

2652.7M20](/packages/cache-cache)[laminas/laminas-cache

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output

1066.7M112](/packages/laminas-laminas-cache)[cache/filesystem-adapter

A PSR-6 cache implementation using filesystem. This implementation supports tags

725.7M77](/packages/cache-filesystem-adapter)[cache/array-adapter

A PSR-6 cache implementation using a php array. This implementation supports tags

568.2M141](/packages/cache-array-adapter)[cache/redis-adapter

A PSR-6 cache implementation using Redis (PhpRedis). This implementation supports tags

563.8M27](/packages/cache-redis-adapter)

PHPackages © 2026

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