Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nabeghe/mem-php
A cool real-time cache using static variable that lets you group keys.
https://github.com/nabeghe/mem-php
cache caching caching-lib helper library php php-cache php-cacher php-helper php-library php-memcached php-memory realtime static
Last synced: 16 days ago
JSON representation
A cool real-time cache using static variable that lets you group keys.
- Host: GitHub
- URL: https://github.com/nabeghe/mem-php
- Owner: nabeghe
- License: mit
- Created: 2024-10-21T19:24:28.000Z (24 days ago)
- Default Branch: master
- Last Pushed: 2024-10-21T19:26:22.000Z (24 days ago)
- Last Synced: 2024-10-22T04:26:08.126Z (23 days ago)
- Topics: cache, caching, caching-lib, helper, library, php, php-cache, php-cacher, php-helper, php-library, php-memcached, php-memory, realtime, static
- Language: PHP
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Mem (Simple Realtime Cache for PHP)
> A cool real-time cache using static variable that lets you group keys.
## 🫡 Usage
### 🚀 Installation
You can install the package via composer:
```bash
composer require nabeghe/mem
```
### Methods Syntax
```php
// Checks if a key exists in a cache group.
Mem::has(mixed $key, mixed $group = 'default'): bool// Checks if a group exists.
Mem::hasGroup(mixed $group): bool// Returns the value of a key from a group.
Mem::get(mixed $key, mixed $group = 'default', mixed $default = null): bool// Changes the value of a key in a group.
Mem::set(mixed $key, mixed $value, mixed $group = 'default'): bool// Deletes a key from a group.
Mem::del($key, $group = 'default'): bool// Returns all groups and their keys.
Mem::all(): array// Returns all keys and values of a group.
Mem::group($group = 'default'): array// Returns the number of existing groups.
Mem::groupsCount(): int// Clears the entire group.
Mem::drop($group = 'default'): bool// Clears the entire cache.
Mem::reset(): bool```
## 📖 License
Copyright (c) Hadi Akbarzadeh
Licensed under the MIT license, see [LICENSE.md](LICENSE.md) for details.