PHPackages                             ahead4/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. ahead4/cache

ActiveLibrary[Caching](/categories/caching)

ahead4/cache
============

A lightweight file-system cache system

v1.0.11(10y ago)011.0k↓50%1MITPHPPHP &gt;=5.3

Since Oct 6Pushed 2y ago5 watchersCompare

[ Source](https://github.com/ahead4ltd/cache)[ Packagist](https://packagist.org/packages/ahead4/cache)[ RSS](/packages/ahead4-cache/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (13)Used By (1)

Cache
=====

[](#cache)

[![Build status](https://camo.githubusercontent.com/82b21eb9af94b1f7879c127c17e8c5ba11fb076643ff519472504869538eba94/68747470733a2f2f7472617669732d63692e6f72672f477265677761722f43616368652e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/82b21eb9af94b1f7879c127c17e8c5ba11fb076643ff519472504869538eba94/68747470733a2f2f7472617669732d63692e6f72672f477265677761722f43616368652e7376673f6272616e63683d6d6173746572)

This is a lightweight cache system based on file and directories.

Usage
=====

[](#usage)

Step 1: Install it
------------------

[](#step-1-install-it)

Via composer:

```
{
    "require": {
        "gregwar/cache": "1.0.*"
    }
}
```

Or with a clone of the repository:

```
git clone https://github.com/Gregwar/Cache.git
```

Or downloading it:

- [Download .zip](https://github.com/Gregwar/Cache/archive/master.zip)
- [Download .tar.gz](https://github.com/Gregwar/Cache/archive/master.tar.gz)

Step 2: Setup the rights
------------------------

[](#step-2-setup-the-rights)

You need your PHP script to have access to the cache directory, you can for instance create a `cache` directory with mode 777:

```
mkdir cache
chmod 777 cache

```

Step 3: Access the cache
------------------------

[](#step-3-access-the-cache)

To access the cache, you can do like this:

```
