PHPackages                             arkonsoft/ps-file-cache - 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. arkonsoft/ps-file-cache

ActiveLibrary[Caching](/categories/caching)

arkonsoft/ps-file-cache
=======================

Simple to file caching library

v1.0.0(2y ago)035[3 issues](https://github.com/Arkonsoft/PS-File-Cache/issues)MITPHPPHP &gt;= 7.0

Since Aug 13Pushed 1y agoCompare

[ Source](https://github.com/Arkonsoft/PS-File-Cache)[ Packagist](https://packagist.org/packages/arkonsoft/ps-file-cache)[ RSS](/packages/arkonsoft-ps-file-cache/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

ps-file-cache
=============

[](#ps-file-cache)

A simple file cache for PHP

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

[](#installation)

`composer require arkonsoft/ps-file-cache`

Usage
-----

[](#usage)

Create a new instance of the cache:

```
use Arkonsoft\PsModule\FileCache;
...
$cache = new FileCache(__DIR__ . '/cache/');

```

Store a value in the cache:

```
$cache->store('key', 'value');

```

Get a value from the cache:

```
$value = $cache->retrieve('key');

```

Retrieve method will also check whether the key is expired or not. You can turn off this feature by passing false as the second argument:

```
$value = $cache->retrieve('key', false);

```

### Important

[](#important)

store() method uses json\_encode() to serialize data. You can store any data beside "resource" type. If you'll try to do it exception will be thrown.

Additional methods
------------------

[](#additional-methods)

### Lifetime

[](#lifetime)

Base lifetime is set to 3600 seconds (1h).

You can change it in the constructor:

```
$cache = new FileCache('path', 6000);

```

Or later with:

```
$cache->setLifetime(6000);

```

### IsStored

[](#isstored)

Check if a key is stored in the cache and is not empty:

```
$cache->isStored('key');

```

### IsExpired

[](#isexpired)

Check if a key is stored in the cache and is expired:

```
$cache->isExpired('key');

```

###  Health Score

20

—

LowBetter than 12% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

734d ago

### Community

Maintainers

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

---

Top Contributors

[![shadownxr](https://avatars.githubusercontent.com/u/38142105?v=4)](https://github.com/shadownxr "shadownxr (5 commits)")

### Embed Badge

![Health badge](/badges/arkonsoft-ps-file-cache/health.svg)

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

###  Alternatives

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[phpfastcache/phpssdb

PHP SSDB Driver for phpFastCache

14736.9k1](/packages/phpfastcache-phpssdb)[rapidwebltd/rw-file-cache

RW File Cache is a PHP File-based Caching Library. Its syntax is designed to closely resemble the PHP memcache extension.

15196.8k7](/packages/rapidwebltd-rw-file-cache)[yuzuru-s/redis-recommend

Wrapping Redis's sorted set APIs for specializing recommending operations.

392.9k](/packages/yuzuru-s-redis-recommend)[ichhabrecht/intcache

Turn uncachable page objects into cacheable links

193.9k](/packages/ichhabrecht-intcache)

PHPackages © 2026

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