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

ActiveLibrary[Caching](/categories/caching)

maslosoft/cache
===============

Easy to use, auto configurable, extensible cache provider

2.0.0(3y ago)05.2k[1 issues](https://github.com/Maslosoft/Cache/issues)1AGPLPHPPHP &gt;=7.4

Since Mar 5Pushed 3y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (3)Versions (14)Used By (1)

[![Cache Logo](https://camo.githubusercontent.com/ba7b582e8c5153eff2fbcba59f74ba691f996b323abb4b650a5b1e2f7eb11a54/68747470733a2f2f6d61736c6f736f66742e636f6d2f63616368652f63616368652e737667)](https://maslosoft.com/cache/) [Maslosoft Cache](https://maslosoft.com/cache/)
=============================================================================================================================================================================================================================================================================

[](#-maslosoft-cache)

[*Easy to use, auto configurable, extensible cache provider*](https://maslosoft.com/cache/)

[![Latest Stable Version](https://camo.githubusercontent.com/29b8b1d13c76482ee02de17b5e7fb213c3b3d0596c09206e6a023778e2b13a76/68747470733a2f2f706f7365722e707567782e6f72672f6d61736c6f736f66742f63616368652f762f737461626c652e737667)](https://packagist.org/packages/maslosoft/cache "Latest Stable Version")[![License](https://camo.githubusercontent.com/0593ecefb0733e85b5f939d8402e73298c26db000718ffe1286ab0e08644f4be/68747470733a2f2f706f7365722e707567782e6f72672f6d61736c6f736f66742f63616368652f6c6963656e73652e737667)](https://packagist.org/packages/maslosoft/cache "License")### Quick Install

[](#quick-install)

```
composer require maslosoft/cache
```

### Documentation

[](#documentation)

[Full Cache Documentation](https://maslosoft.com/cache/docs/)

Self configuring cache
======================

[](#self-configuring-cache)

This cache library provides consistent interface for popular cache systems. It uses best cache provider available based on configurable list.

Also provides logic-less getting of cache value, with fallback to callable.

###### Easy to use, auto configurable, extensible cache provider

[](#easy-to-use-auto-configurable-extensible-cache-provider)

If you need some modern cache with just basic features here it is.

It implements only basic cache operations:

- has - to check if has key in cache
- get - to get cached value by key
- set - to set value to cache
- remove - to remove cached value
- clear - to clear entira cache

Requirements
------------

[](#requirements)

- PHP 5.6+
- composer

Setup
-----

[](#setup)

Use composer to install extension:

```
composer require maslosoft/cache:"*"

```

Setup cache. After calling `init` any further instance will be configured same as below `$cache`.

```
use Maslosoft\Cache\Cache;

$cache = new Cache();
// Setup something here...
$cache->timeout = 1244;
$cache->init();

```

Basic Usage
-----------

[](#basic-usage)

```
