{"id":27872893,"url":"https://github.com/dantodev/php-simple-redis-cache","last_synced_at":"2025-08-22T05:04:37.047Z","repository":{"id":56972986,"uuid":"85464421","full_name":"dantodev/php-simple-redis-cache","owner":"dantodev","description":"A simple redis cache class using Predis","archived":false,"fork":false,"pushed_at":"2019-02-14T11:37:12.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-15T14:59:24.381Z","etag":null,"topics":["cache","php","redis","redis-cache"],"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/dantodev.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":"2017-03-19T09:27:19.000Z","updated_at":"2023-06-04T17:36:41.000Z","dependencies_parsed_at":"2022-08-21T10:20:50.878Z","dependency_job_id":null,"html_url":"https://github.com/dantodev/php-simple-redis-cache","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dantodev/php-simple-redis-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantodev%2Fphp-simple-redis-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantodev%2Fphp-simple-redis-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantodev%2Fphp-simple-redis-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantodev%2Fphp-simple-redis-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dantodev","download_url":"https://codeload.github.com/dantodev/php-simple-redis-cache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantodev%2Fphp-simple-redis-cache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271588743,"owners_count":24785751,"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-08-22T02:00:08.480Z","response_time":65,"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","php","redis","redis-cache"],"created_at":"2025-05-05T01:01:34.681Z","updated_at":"2025-08-22T05:04:37.026Z","avatar_url":"https://github.com/dantodev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/dtkahl/php-simple-redis-cache/v/stable)](https://packagist.org/packages/dtkahl/php-simple-redis-cache)\n[![License](https://poser.pugx.org/dtkahl/php-simple-redis-cache/license)](https://packagist.org/packages/dtkahl/php-simple-redis-cache)\n[![Build Status](https://travis-ci.org/dtkahl/php-simple-redis-cache.svg?branch=master)](https://travis-ci.org/dtkahl/php-simple-redis-cache)\n\n\n# PHP simple redis cache\n\nThis is a simple cache class for PHP using redis trough `predis/predis`.\n\n#### Dependencies\n\n* `PHP \u003e= 5.6.0`\n* a redis server\n\n\n#### Installation\n\nInstall with [Composer](http://getcomposer.org):\n```\ncomposer require dtkahl/php-simple-redis-cache\n```\n\n\n### Usage\n\nRefer namespace:\n\n```\nuse Dtkahl\\SimpleRedisCache;\n```\n\nCreate new Cache instance:\n\n```php\n$cache = new Cache([\n    \"scheme\" =\u003e \"tcp\",\n    \"host =\u003e \"127.0.0.1\",\n    \"port\" =\u003e 6379\n);\n```\n\n\n### Methods\n\n#### `put($key, $value, $time = null)`\n\nPut item to cache. (time in seconds)\n\n```php\n$cache-\u003eput('foo', 'bar', 60)\n```\n\n\n#### `has($key)`\n\nDeterminate if key exists in cache.\n\n```php\n$cache-\u003ehas('foo')\n```\n\n\n#### `get($key, $default = null)`\n\nReturn Item from cache or `$default`.\n\n```php\n$cache-\u003eget('foo', 'default')\n```\n\n\n#### `forget($key)`\n\nRemove item from cache.\n\n```php\n$cache-\u003eforget('foo')\n```\n\n\n#### `forever($key, $value)`\n\nStore item in cache forever.\n\n```php\n$cache-\u003eforever('foo', 'bar')\n```\n\n\n#### `remember($key, $callback, $time = null)`\n\nReturn cache item if exists otherwise call `$callback`, cache the returned value and return it.\n\n```php\n$cache-\u003eput('foo')\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdantodev%2Fphp-simple-redis-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdantodev%2Fphp-simple-redis-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdantodev%2Fphp-simple-redis-cache/lists"}