Modern cache adapter for PHP Projects.
- PHP ^7.0 Syntax
- PSR-4
- PSR-16
- Factory and Adapter Pattern
- Exception
This library is PSR-4 comply. You can use it on every framework that support composer.
- CodeIgniter 3/4
- Laravel
- Yii
- Your framework?
- Native PHP
- Redis
- Memcached
- File
- MongoDB
Next plan : ApacheIgnite
composer require gemblue/tiny-cache
use Gemblue\TinyCache\CacheFactory;
$cacheFactory = new CacheFactory;
$cache = $cacheFactory->getInstance([
'driver' => 'Memcached',
'host' => 'localhost',
'post' => 11211,
'persistence' => true
]);For full example, browse example folder.
| Method | Desc |
|---|---|
| set | Set a key |
| get | Get a key |
| delete | Delete a key |
| clear | Wipe all key |
| has | Check key existance |
| setMultiple | Set multiple key |
| getMultiple | Get multiple key |
| deleteMultiple | Delete multiple key |
To delete caches with any prefix, just call like this:
$cache->delete('prefix_*');- @gemblue
- @yllumi