{"id":20672484,"url":"https://github.com/robinn1/cache","last_synced_at":"2025-08-02T08:36:23.450Z","repository":{"id":37526548,"uuid":"428077631","full_name":"RobiNN1/Cache","owner":"RobiNN1","description":"Simple cache for PHP with support for Redis, Memcached, APCu and Files.","archived":false,"fork":false,"pushed_at":"2024-12-23T00:47:28.000Z","size":126,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-22T19:54:04.736Z","etag":null,"topics":["cache","caching","file","memcache","php","redis"],"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/RobiNN1.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.paypal.me/robertkelcak"]}},"created_at":"2021-11-15T00:42:26.000Z","updated_at":"2025-02-16T06:26:31.000Z","dependencies_parsed_at":"2023-02-12T18:45:25.585Z","dependency_job_id":"fa6f26c0-3ee5-4543-9a34-e531756059ef","html_url":"https://github.com/RobiNN1/Cache","commit_stats":{"total_commits":89,"total_committers":2,"mean_commits":44.5,"dds":"0.011235955056179803","last_synced_commit":"f79eec0b75d41abf3a63257e3c19d65ad8b758a0"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/RobiNN1/Cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobiNN1%2FCache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobiNN1%2FCache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobiNN1%2FCache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobiNN1%2FCache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobiNN1","download_url":"https://codeload.github.com/RobiNN1/Cache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobiNN1%2FCache/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268355792,"owners_count":24237369,"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-02T02:00:12.353Z","response_time":74,"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","file","memcache","php","redis"],"created_at":"2024-11-16T20:37:46.455Z","updated_at":"2025-08-02T08:36:23.405Z","avatar_url":"https://github.com/RobiNN1.png","language":"PHP","readme":"# Simple cache\n\nSimple cache for PHP with support for Redis, Memcached, APCu, and Files.\n\n![Visitor Badge](https://visitor-badge.laobi.icu/badge?page_id=RobiNN1.Cache)\n\n## Installation\n\n```\ncomposer require robinn/cache\n```\n\n## Usage\n\n```php\n$cache = new RobiNN\\Cache\\Cache([\n    // Available config options\n    'storage'   =\u003e 'file', // apcu|file|memcached|redis\n    'file'      =\u003e [\n        'path' =\u003e __DIR__.'/cache', // The path to the folder containing the cached content.\n        //'secret' =\u003e 'secret_key', // For securing file names (optional).\n        //'remove_expired' =\u003e true, // Automatically remove all expired keys (it can affect performance) (optional).\n    ],\n    'redis'     =\u003e [\n        'host' =\u003e '127.0.0.1', // Optional when a path is specified.\n        'port' =\u003e 6379, // Optional when the default port is used.\n        //'database' =\u003e 0, // Default database (optional).\n        //'username' =\u003e '', // ACL - requires Redis \u003e= 6.0 (optional).\n        //'password' =\u003e '', // Optional.\n        //'path' =\u003e '/var/run/redis/redis-server.sock', // Unix domain socket (optional).\n    ],\n    'memcached' =\u003e [\n        'host' =\u003e '127.0.0.1', // Optional when a path is specified.\n        'port' =\u003e 11211, // Optional when the default port is used.\n        //'path' =\u003e '/var/run/memcached/memcached.sock', // Unix domain socket (optional).\n        //'sasl_username' =\u003e '', // SASL auth (optional).\n        //'sasl_password' =\u003e '', // SASL auth (optional).\n    ],\n]);\n\n$key = 'item-key';\n\nif ($cache-\u003eexists($key)) {\n    $data = $cache-\u003eget($key);\n} else {\n    $data = 'item-value';\n    $cache-\u003eset($key, $data);\n}\n\n// The above code can also be shortened to one line\n$data = $cache-\u003eremember($key, 'item-value');\n\nprint_r($data); // item-value\n```\n\n## Methods\n\n| Name        | Return | Description                                |\n|-------------|--------|--------------------------------------------|\n| isConnected | bool   | Check connection.                          |\n| exists      | bool   | Check if the data is cached.               |\n| set         | bool   | Save data to cache.                        |\n| get         | mixed  | Get data by key.                           |\n| remember    | mixed  | Get the data or store if it is not cached. |\n| delete      | bool   | Delete data by key.                        |\n| flush       | bool   | Delete all data from cache.                |\n\n## Requirements\n\n- PHP \u003e= 8.2\n","funding_links":["https://www.paypal.me/robertkelcak"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinn1%2Fcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobinn1%2Fcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinn1%2Fcache/lists"}