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

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

sharnw/filecached-php
=====================

A simple PHP key-value datastore using filesystem instead of memory

0132PHP

Since Dec 7Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Sharnw/filecached-php)[ Packagist](https://packagist.org/packages/sharnw/filecached-php)[ RSS](/packages/sharnw-filecached-php/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Filecached - PHP datastore
==========================

[](#filecached---php-datastore)

A simple key-value datastore using filesystem instead of memory.

Useful for caching large datasets, and replacing memcache on low memory AWS instances.

Credit to  for the original.

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

[](#installation)

Add the following line to your composer.json file:

```
{
    "require": {
        "sharnw/filecached-php": "dev-master"
    }
}

```

Usage
-----

[](#usage)

Similar interface to memcache

- `set(k, v)` set key-value pair
- `get(k)` get key value, returns false if nothing present
- `delete(k)` delete key-value pair
- `flush()` wipe all cache data

### Demo

[](#demo)

```
require_once('src/cache.php');

$cache = new Filecached\Cache();

$example_data = [
    'time' => time(),
    'message' => 'something certainly happened today.',
];

$cache->set('todays_news', $example_data);

print_r($storeData = $cache->get('todays_news'));

$example_data = [
    [
        'url' => 'https://libraries.io/github/hustcc/php-file-cache',
        'title' => 'Forked repo'
    ],
];

$cache->set('todays_links', $example_data);

print_r($storeData = $cache->get('todays_links'));

$cache->flush('today_'); // flush all data in 'today/' namespace

$cache->set('more data', ['blah']);

$cache->flush(); // flush all data

```

License
-------

[](#license)

Released under the terms of the [MIT license](http://opensource.org/licenses/MIT).

Links
-----

[](#links)

- Forked lib -

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/943685f953e36e96bfd8a6c4f9516288bc99d79ed67cf76229cf0d0e5eb255ed?d=identicon)[Sharnw](/maintainers/Sharnw)

---

Top Contributors

[![Sharnw](https://avatars.githubusercontent.com/u/916375?v=4)](https://github.com/Sharnw "Sharnw (6 commits)")

### Embed Badge

![Health badge](/badges/sharnw-filecached-php/health.svg)

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

###  Alternatives

[venveo/craft-compress

Create smart zip files from Craft assets on the fly

124.7k](/packages/venveo-craft-compress)

PHPackages © 2026

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