{"id":28955806,"url":"https://github.com/kodedphp/cache-extended","last_synced_at":"2025-08-01T12:14:23.235Z","repository":{"id":52250648,"uuid":"153984824","full_name":"kodedphp/cache-extended","owner":"kodedphp","description":"A PSR-6 caching library.","archived":false,"fork":false,"pushed_at":"2021-05-03T13:47:05.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-23T20:10:05.950Z","etag":null,"topics":["cache","caching","filecache","json","memcached","psr-6","redis"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kodedphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-21T07:44:45.000Z","updated_at":"2021-05-03T13:46:05.000Z","dependencies_parsed_at":"2022-08-30T19:50:54.538Z","dependency_job_id":null,"html_url":"https://github.com/kodedphp/cache-extended","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/kodedphp/cache-extended","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedphp%2Fcache-extended","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedphp%2Fcache-extended/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedphp%2Fcache-extended/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedphp%2Fcache-extended/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kodedphp","download_url":"https://codeload.github.com/kodedphp/cache-extended/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedphp%2Fcache-extended/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267021561,"owners_count":24022867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"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","caching","filecache","json","memcached","psr-6","redis"],"created_at":"2025-06-23T20:10:05.990Z","updated_at":"2025-08-01T12:14:23.200Z","avatar_url":"https://github.com/kodedphp.png","language":"PHP","readme":"Koded - Extended Caching Library\n================================\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/koded/cache-extended.svg)](https://packagist.org/packages/koded/cache-extended)\n[![Build Status](https://travis-ci.org/kodedphp/cache-extended.svg?branch=master)](https://travis-ci.org/kodedphp/cache-extended)\n[![Code Coverage](https://scrutinizer-ci.com/g/kodedphp/cache-extended/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/kodedphp/cache-extended/?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/kodedphp/cache-extended/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/kodedphp/cache-extended/?branch=master)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.0-8892BF.svg)](https://php.net/)\n[![Software license](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](LICENSE)\n\nA [PSR-6][psr-6] caching library for PHP 7 using several caching technologies.\n\n\nRequirements\n------------\n\n- Linux machine\n- PHP 8\n\nRecommended cache technologies are\n\n- Redis server\n- Memcached\n\nRecommended PHP modules\n\n- [Redis extension]\n- [Memcached extension]\n\nFor developing purposes you can use\n\n- Memory client (default)\n- File client\n\n\nUsage\n-----\n\n- create an instance of `CacheItemPoolInterface` with desired caching technology\n- manipulate the cache items with the pool instance\n\n\n```php\n$cache = CachePool::use('redis');\n\n$item = $cache-\u003egetItem('fubar');\n$item-\u003eset('some value');\n$item-\u003eexpiresAfter(new DateTime('3 days'));\n\n$cache-\u003esave();\n```\n\n**The pool instance is created only once.**\n\n\u003e `CachePool::use()` accepts specific parameters for the underlying caching technology.  \nThis method uses the [Koded Simple Cache][koded-cache-simple] package.\nPlease see the README in that repository for the specific arguments.\n\nYou can grab the cache client if you want to use it directly\n\n```php\n/** $var Koded\\Caching\\Cache $client */\n$client = $cache-\u003eclient();\n```\n\nDeferring the items\n-------------------\n\nTo postpone the saving of the cache items (store all items \"at once\"),\nyou can use the `saveDeferred()` method. These cache items are saved when you\n\n- execute `commit()`\n- when `CacheItemPoolInterface` instance is destroyed\n\n**Keep in mind that `commit()` is not an atomic operation.**\nThere is no guarantee that all items will be saved, because anything can\nhappen while `save()` runs (network, client crash, etc).\n\n```php\n$cache-\u003esaveDeferred($event);\n$cache-\u003esaveDeferred($counter);\n\n// ... do some stuff\n\n// store this now\n$cache-\u003esave($dependency);\n\n// ... do more stuff\n\n$cache-\u003esaveDeferred($updates);\n$cache-\u003esaveDeferred($extras);\n\n// Store all deferred items\n$cache-\u003ecommit();\n```\n\nLicense\n-------\n\nThe code is distributed under the terms of [The 3-Clause BSD license](LICENSE).\n\n\n[psr-6]: http://www.php-fig.org/psr/psr-6/\n[koded-cache-simple]: https://github.com/kodedphp/cache-simple#configuration-directives\n[Redis extension]: https://github.com/phpredis/phpredis/blob/develop/INSTALL.markdown\n[Memcached extension]: https://github.com/php-memcached-dev/php-memcached\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodedphp%2Fcache-extended","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkodedphp%2Fcache-extended","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodedphp%2Fcache-extended/lists"}