Download the PHP package vaibhavpandeyvpz/godam without Composer
On this page you can find all versions of the php package vaibhavpandeyvpz/godam. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vaibhavpandeyvpz/godam
More information about vaibhavpandeyvpz/godam
Files in vaibhavpandeyvpz/godam
Package godam
Short Description A modern, PSR-6 and PSR-16 compliant caching library for PHP 8.2+ with support for multiple storage backends.
License MIT
Homepage https://github.com/vaibhavpandeyvpz/godam
Informations about the package godam
vaibhavpandeyvpz/godam
A modern, PSR-6 and PSR-16 compliant caching library for PHP 8.2+ with support for multiple storage backends.
Godam (
गोदाम) means "Warehouse" in Hindi
Features
- ✅ PSR-6 (Cache Item Pool Interface) compliant
- ✅ PSR-16 (Simple Cache Interface) compliant
- ✅ Multiple storage backends: Memory, FileSystem, Redis, Memcache, Predis
- ✅ TTL (Time To Live) support with flexible expiration
- ✅ Type-safe with PHP 8.2+ features
- ✅ 100% test coverage
- ✅ Zero dependencies (except PSR interfaces)
Installation
Install via Composer:
Optional Dependencies
For Redis support, you can use either:
ext-redis(PECL extension)predis/predis(pure PHP client)
For Memcache support:
ext-memcache(PECL extension)
Storage Backends
Godam supports multiple storage backends through the StoreInterface:
MemoryStore
In-memory cache that stores data in PHP arrays. Perfect for testing or single-request caching.
FileSystemStore
File-based cache that stores data on disk. Ideal for applications without external cache servers.
RedisStore
Redis cache using the ext-redis extension.
PredisStore
Redis cache using the predis/predis library (pure PHP, no extension required).
MemcacheStore
Memcache cache using the ext-memcache extension.
Usage
PSR-16 Simple Cache Interface
The Cache class provides a simple, straightforward caching interface:
PSR-6 Cache Item Pool Interface
The CacheItemPool class provides a more advanced caching interface with cache items:
TTL (Time To Live) Examples
Advanced Usage
Custom Storage Backend
You can create your own storage backend by implementing the StoreInterface:
Error Handling
Requirements
- PHP >= 8.2
- PSR Cache interfaces (automatically installed via Composer)
Testing
Run the test suite:
Or with PHPUnit directly:
License
This project is open-sourced software licensed under the MIT License.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Links
All versions of godam with dependencies
psr/cache Version ^1.0 || ^2.0 || ^3.0
psr/simple-cache Version ^1.0 || ^2.0 || ^3.0