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

ActiveLibrary[Caching](/categories/caching)

gregwar/cache
=============

A lightweight file-system cache system

v1.0.13(5y ago)1084.5M—3.8%30[4 issues](https://github.com/Gregwar/Cache/issues)[3 PRs](https://github.com/Gregwar/Cache/pulls)18MITPHPPHP &gt;=5.3

Since Oct 6Pushed 5y ago5 watchersCompare

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

READMEChangelogDependenciesVersions (15)Used By (18)

Cache
=====

[](#cache)

[![Build status](https://camo.githubusercontent.com/82b21eb9af94b1f7879c127c17e8c5ba11fb076643ff519472504869538eba94/68747470733a2f2f7472617669732d63692e6f72672f477265677761722f43616368652e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/82b21eb9af94b1f7879c127c17e8c5ba11fb076643ff519472504869538eba94/68747470733a2f2f7472617669732d63692e6f72672f477265677761722f43616368652e7376673f6272616e63683d6d6173746572)[![paypal](https://camo.githubusercontent.com/e1ff554a09e8e92bef25abc553ff05b88f45afd695877cf12f3a46558ef65b2e/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e61746543435f4c472e676966)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YUXRLWHQSWS6L)

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 (be sure the web server can write it):

```
mkdir cache

```

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

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

To access the cache, you can do like this:

```
