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

ActiveLibrary[Caching](/categories/caching)

toast/cache
===========

Toast PSR-6-compatible cache module

0.5.2(1y ago)0160[2 PRs](https://github.com/toast-php/cache/pulls)1MITPHPCI failing

Since Jul 10Pushed 3w ago1 watchersCompare

[ Source](https://github.com/toast-php/cache)[ Packagist](https://packagist.org/packages/toast/cache)[ RSS](/packages/toast-cache/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (4)Versions (17)Used By (1)

Cache
=====

[](#cache)

Caching module for the Toast test framework

Why would a testing framework need caching, you might ask? Well, sometimes a particular piece of code does something that isn't that easily otherwise checked (e.g. sending a mail), or if you write [acceptance tests](http://toast.monomelodies.nl/acceptance) you might need a way to check if the external server did something correctly. The module is called `cache` because it's fully PSR-16 compliant, but you really should think of it more as a shared pool you can access for temporary storage while running a test scenario.

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

[](#installation)

### Using composer (recommended)

[](#using-composer-recommended)

```
composer require toast/cache
```

### Manual

[](#manual)

- Download or clone the repository somewhere;
- Register `/path/to/cache/src` for the `Toast\Cache` namespace in your autoloader.

Initialising a cache pool
-------------------------

[](#initialising-a-cache-pool)

Create a new `Toast\Cache\Cache` object like so:

```
