{"id":23115484,"url":"https://github.com/eghojansu/cache-helper","last_synced_at":"2026-05-18T15:02:09.188Z","repository":{"id":56975682,"uuid":"122028507","full_name":"eghojansu/cache-helper","owner":"eghojansu","description":"PHP Cache helper","archived":false,"fork":false,"pushed_at":"2018-02-22T05:18:43.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-22T20:41:16.536Z","etag":null,"topics":["apc","apcu","cache","filecache","memcached","php","redis","wincache","xcache"],"latest_commit_sha":null,"homepage":null,"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/eghojansu.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-02-19T06:58:16.000Z","updated_at":"2022-11-21T19:27:44.000Z","dependencies_parsed_at":"2022-08-21T11:20:30.649Z","dependency_job_id":null,"html_url":"https://github.com/eghojansu/cache-helper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eghojansu/cache-helper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eghojansu%2Fcache-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eghojansu%2Fcache-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eghojansu%2Fcache-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eghojansu%2Fcache-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eghojansu","download_url":"https://codeload.github.com/eghojansu/cache-helper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eghojansu%2Fcache-helper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274978914,"owners_count":25384752,"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-09-13T02:00:10.085Z","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":["apc","apcu","cache","filecache","memcached","php","redis","wincache","xcache"],"created_at":"2024-12-17T03:41:32.786Z","updated_at":"2026-05-18T15:02:04.157Z","avatar_url":"https://github.com/eghojansu.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"PHP Cache-Helper\n================\n\nPHP Caching helper. It supports several cache-engine.\n\n- Apc;\n- Apcu;\n- Memcached;\n- Redis;\n- Wincache;\n- Xcache;\n- FileCache (as an alternative or fallback).\n\nBackground\n----------\n\nThe original code taken from [Fatfree][1] Cache class. Because the original code was very complex for me, i decide to make this repo.\n\nInstallation\n------------\n\n`composer require eghojansu/cache-helper:dev-master`\n\nUsage\n-----\n\nMain Cache class will proxy method call to the driver.\nTo use a driver you can pass simple dsn format to first constructor.\n\n```php\n\u003c?php\n\nuse Fal\\Cache\\Cache;\nuse Fal\\Cache\\Serializer;\n\n$cache = new Cache(\n    // simple dsn, @see simple dsn table below, pass '' (empty string) to disable\n    'apcu',\n    // prefix, can pass '' (empty string) but not null value\n    '',\n    // fallback file cache dir\n    '/path/to/cache/dir/fallback',\n    // Serializer helper\n    new Serializer()\n);\n\n// get cache, it will return empty array if cache does not exist or cache was expired\n// if cache exist it return array of [data, time, ttl]\n$cached = $cache-\u003eget('foo');\nif ($cached) {\n    list( $data ) = $cached;\n} else {\n    $data = 'foo';\n    $cache-\u003eset('foo', $data);\n}\n\necho $data;\n\n```\n\nDSN Format\n----------\n\n```\n+-----------+----------------------------------------------------+------------------------+\n| Driver    | DSN                                                | ~                      |\n+-----------+----------------------------------------------------+------------------------+\n| Apc       | apc                                                |                        |\n| Apcu      | apcu                                               |                        |\n| Memcached | memcached=host[:port];host2[:port];...hostn[:port] |                        |\n| Redis     | redis=host[:port[:db]]                             |                        |\n| Wincache  | wincache                                           |                        |\n| Xcache    | xcache                                             |                        |\n| Filecache | folder=/path/to/cache/dir/                         | Require trailing slash |\n| NoCache   | (empty string)                                     | To disable cache       |\n+-----------+----------------------------------------------------+------------------------+\n```\n\nIf dsn supplied and no match based on above rule, FileCache will be used.\n\nCredits\n-------\n\n- [Fatfree Framework Author and Contributors][1]\n\n\n[1]: http://fatfreeframework.com","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feghojansu%2Fcache-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feghojansu%2Fcache-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feghojansu%2Fcache-helper/lists"}