Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gemblue/tinycache
Simple Cache Adapter for PHP Projects, PSR-16 Comply
https://github.com/gemblue/tinycache
Last synced: about 2 months ago
JSON representation
Simple Cache Adapter for PHP Projects, PSR-16 Comply
- Host: GitHub
- URL: https://github.com/gemblue/tinycache
- Owner: gemblue
- Created: 2020-04-19T17:55:59.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-04T05:21:09.000Z (over 2 years ago)
- Last Synced: 2024-10-28T12:56:54.726Z (2 months ago)
- Language: PHP
- Homepage:
- Size: 52.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TinyCache
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
- MongoDBNext plan : ApacheIgnite
## Installation
`composer require gemblue/tiny-cache`
## Usage
```php
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:
```php
$cache->delete('prefix_*');
```## Developed By
- @gemblue
- @yllumi