{"id":15487185,"url":"https://github.com/byjg/php-cache-engine","last_synced_at":"2026-02-22T03:06:14.629Z","repository":{"id":35205682,"uuid":"39464518","full_name":"byjg/php-cache-engine","owner":"byjg","description":"A multi-purpose cache engine PSR-6 and PSR-16 implementation with several drivers.","archived":false,"fork":false,"pushed_at":"2025-12-20T20:00:58.000Z","size":199,"stargazers_count":11,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-22T20:08:44.378Z","etag":null,"topics":["cache","cachepool","memcached","php","psr-16","psr-6","redis","shared-memory"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/byjg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"byjg"}},"created_at":"2015-07-21T19:06:13.000Z","updated_at":"2025-11-28T10:33:33.000Z","dependencies_parsed_at":"2024-06-19T05:31:08.736Z","dependency_job_id":"c979ea9f-12b7-494b-9bc5-3aca405d15e6","html_url":"https://github.com/byjg/php-cache-engine","commit_stats":{"total_commits":111,"total_committers":3,"mean_commits":37.0,"dds":"0.018018018018018056","last_synced_commit":"f4f0c6ffbf2965d7437448db156365a72f2e16d1"},"previous_names":["byjg/php-cache-engine","byjg/cache-engine-php"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/byjg/php-cache-engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byjg%2Fphp-cache-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byjg%2Fphp-cache-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byjg%2Fphp-cache-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byjg%2Fphp-cache-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byjg","download_url":"https://codeload.github.com/byjg/php-cache-engine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byjg%2Fphp-cache-engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29704404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T23:35:04.139Z","status":"online","status_checked_at":"2026-02-22T02:00:08.193Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","cachepool","memcached","php","psr-16","psr-6","redis","shared-memory"],"created_at":"2024-10-02T06:21:37.597Z","updated_at":"2026-02-22T03:06:14.624Z","avatar_url":"https://github.com/byjg.png","language":"PHP","funding_links":["https://github.com/sponsors/byjg"],"categories":[],"sub_categories":[],"readme":"# Cache Engine\n\n[![Sponsor](https://img.shields.io/badge/Sponsor-%23ea4aaa?logo=githubsponsors\u0026logoColor=white\u0026labelColor=0d1117)](https://github.com/sponsors/byjg)\n[![Build Status](https://github.com/byjg/php-cache-engine/actions/workflows/phpunit.yml/badge.svg?branch=master)](https://github.com/byjg/php-cache-engine/actions/workflows/phpunit.yml)\n[![Opensource ByJG](https://img.shields.io/badge/opensource-byjg-success.svg)](http://opensource.byjg.com)\n[![GitHub source](https://img.shields.io/badge/Github-source-informational?logo=github)](https://github.com/byjg/php-cache-engine/)\n[![GitHub license](https://img.shields.io/github/license/byjg/php-cache-engine.svg)](https://opensource.byjg.com/opensource/licensing.html)\n[![GitHub release](https://img.shields.io/github/release/byjg/php-cache-engine.svg)](https://github.com/byjg/php-cache-engine/releases/)\n\nA powerful, versatile cache implementation providing both PSR-6 and PSR-16 interfaces with support for multiple storage drivers.\n\n## Key Features\n\n- **PSR-16 Simple Cache interface** - Simple, straightforward caching API\n- **PSR-6 Cache Pool interface** - More verbose caching with fine-grained control\n- **Multiple storage backends** - Choose from memory, file system, Redis, Memcached and more\n- **Atomic operations** - Support for increment, decrement and add operations in compatible engines\n- **Garbage collection** - Automatic cleanup of expired items \n- **PSR-11 container support** - Retrieve cache keys via dependency container\n- **Logging capabilities** - PSR-3 compatible logging of cache operations\n\n## Quick Start\n\n```bash\ncomposer require \"byjg/cache-engine\"\n```\n\n```php\n// PSR-16 Simple Cache\n$cache = new \\ByJG\\Cache\\Psr16\\FileSystemCacheEngine();\n$cache-\u003eset('key', 'value', 3600); // Cache for 1 hour\n$value = $cache-\u003eget('key');\n\n// PSR-6 Cache Pool\n$pool = \\ByJG\\Cache\\Factory::createFilePool();\n$item = $pool-\u003egetItem('key');\nif (!$item-\u003eisHit()) {\n    $item-\u003eset('value');\n    $item-\u003eexpiresAfter(3600);\n    $pool-\u003esave($item);\n}\n$value = $item-\u003eget();\n```\n\n## Documentation\n\n### Getting Started\n- [PSR-16 Simple Cache Usage](docs/basic-usage-psr16-simplecache.md)\n- [PSR-6 Cache Pool Usage](docs/basic-usage-psr6-cachepool.md)\n\n### Available Cache Engines\n| Engine                                                              | Description                                             |\n|:--------------------------------------------------------------------|:--------------------------------------------------------|\n| [NoCacheEngine](docs/class-no-cache-engine.md)                      | No-op engine for disabling cache without code changes   |\n| [ArrayCacheEngine](docs/class-array-cache-engine.md)                | In-memory array cache (non-persistent between requests) |\n| [FileSystemCacheEngine](docs/class-filesystem-cache-engine.md)      | File system based caching                               |\n| [MemcachedEngine](docs/class-memcached-engine.md)                   | Memcached distributed caching                           |\n| [RedisCacheEngine](docs/class-redis-cache-engine.md)                | Redis-based caching                                     |\n| [SessionCacheEngine](docs/class-session-cache-engine.md)            | PHP session-based caching                               |\n| [TmpfsCacheEngine](docs/class-tmpfs-cache-engine.md)                | Tmpfs-based caching                                     |\n| [ShmopCacheEngine](docs/class-shmop-cache-engine.md)                | Shared memory caching (deprecated)                      |\n| [KeyValueCacheEngine](https://github.com/byjg/php-anydataset-nosql) | S3-Like or CloudflareKV storage (separate package)      |\n\n### Advanced Features\n- [Atomic Operations](docs/atomic-operations.md)\n- [Garbage Collection](docs/garbage-collection.md)\n- [Logging](docs/setup-log-handler.md)\n- [PSR-11 Container Usage](docs/psr11-usage.md)\n\n## Running Unit Tests\n\n```\nvendor/bin/phpunit --stderr\n```\n\n**Note:** The `--stderr` parameter is required for SessionCacheEngine tests to run properly.\n\n## Dependencies\n\n```mermaid\nflowchart TD\n    byjg/cache-engine --\u003e psr/cache\n    byjg/cache-engine --\u003e psr/log\n    byjg/cache-engine --\u003e psr/simple-cache\n    byjg/cache-engine --\u003e psr/container\n```\n\n----\n[Open source ByJG](http://opensource.byjg.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyjg%2Fphp-cache-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyjg%2Fphp-cache-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyjg%2Fphp-cache-engine/lists"}