PHPackages                             idct/php-array-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. idct/php-array-file-cache

ActiveLibrary[Caching](/categories/caching)

idct/php-array-file-cache
=========================

Simple file-based cache system for PHP.

0.2.2(7y ago)0531MITPHPPHP &gt;=5.4.0

Since Nov 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/bpacholek/php-array-file-cache)[ Packagist](https://packagist.org/packages/idct/php-array-file-cache)[ Docs](https://github.com/ideaconnect/idct-php-array-file-cache)[ RSS](/packages/idct-php-array-file-cache/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (5)Used By (0)

idct-php-array-file-cache
=========================

[](#idct-php-array-file-cache)

Simple file-based caching system for PHP which allows storing and retrieval of data in and from files using a simple array interface.

usage example
=============

[](#usage-example)

```
use IDCT\FileArrayCache;

$cache = new FileArrayCache("/tmp");

//saving:
$yourData = ['value_int' => 1, 'value_string' => 'test'];
$cache["myCacheKey"] = $yourData;

//reading:
$data = $cache["myCacheKey"];
```

To clear all entries in cache, but keep the folder and config use `clearCache()`method.

installation
============

[](#installation)

In case you do not use any package manager in your code then be sure to include all classes and interfaces.

Suggested way is to use Composer\[\] and install the library in your project using:

```
composer require idct/php-array-file-cache
```

initialization
==============

[](#initialization)

Create an instance of `FileArrayCache` by calling its constructor. One parameter is mandatory:

- `$cachePath` which must point to a writable and readable directory where cache will be or is stored. Warning: if a cache with `cache_config` file (after version 0.2) exists already in the folder then initialization will be verified with it: failure will throw a `LogicException`.

Optional parameters:

- `int $levels`: Amount of subfolder levels used to limit files count in a single folder. Defaults to 2.
- `IHashAlgo $hashAlgo`: Algorithm used to build the filename: a hash out of the given key. Must implement `IHashAlgo`. Defaults to `Md5`.
- `ICodec $codec`: Encoder / decoder which converts provided objects into strings (and the other way around) stored in files. Defaults to `JsonCodec`.

contribution
============

[](#contribution)

To contribute please just file an issue or merge request (pull request). Whenever possible please try to keep backwards-compatiblity.

Be sure to follow latest coding standards!

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

Total

3

Last Release

2671d ago

### Community

Maintainers

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

---

Tags

phpserializecachefilestorage

### Embed Badge

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

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

###  Alternatives

[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[lochmueller/staticfilecache

Transparent static file cache solution using mod\_rewrite and mod\_expires. Increase performance for static pages by a factor of 230!!

1311.3M3](/packages/lochmueller-staticfilecache)[swayok/alternative-laravel-cache

Replacements for Laravel's redis and file cache stores that properly implement tagging idea. Powered by cache pool implementations provided by http://www.php-cache.com/

202541.1k6](/packages/swayok-alternative-laravel-cache)[alekseykorzun/memcached-wrapper-php

Optimized PHP 5 wrapper for Memcached extension that supports dog-piling, igbinary and local storage

2984.6k1](/packages/alekseykorzun-memcached-wrapper-php)[mantoufan/yzhancache

Simple, effient cache class for PHP. 简单、高效的 PHP 缓存类

341.5k2](/packages/mantoufan-yzhancache)

PHPackages © 2026

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