gemblue / tiny-cache
Simple Cache Adapter for PHP Projects, PSR-16 Comply
Installs: 242
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/gemblue/tiny-cache
Requires
- php: ^7.2.5 || ^8.0
This package is not auto-updated.
Last update: 2025-10-14 19:24:45 UTC
README
Modern cache adapter for PHP Projects.
- PHP ^7.0 Syntax
- PSR-4
- PSR-16
- Factory and Adapter Pattern
- Exception
Supported Framework
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
Supported Drivers
- Redis
- Memcached
- File
- MongoDB
Next plan : ApacheIgnite
Installation
composer require gemblue/tiny-cache
Usage
use Gemblue\TinyCache\CacheFactory; $cacheFactory = new CacheFactory; $cache = $cacheFactory->getInstance([ 'driver' => 'Memcached', 'host' => 'localhost', 'post' => 11211, 'persistence' => true ]);
For full example, browse example folder.
API
| 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 |
Delete by Prefix
To delete caches with any prefix, just call like this:
$cache->delete('prefix_*');
Developed By
- @gemblue
- @yllumi