{"id":21771124,"url":"https://github.com/initphp/redis","last_synced_at":"2026-05-24T11:01:42.733Z","repository":{"id":62727731,"uuid":"559805813","full_name":"InitPHP/Redis","owner":"InitPHP","description":"PHP Redis Management Library","archived":false,"fork":false,"pushed_at":"2022-11-05T06:22:06.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T03:13:44.150Z","etag":null,"topics":[],"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/InitPHP.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":"2022-10-31T06:02:59.000Z","updated_at":"2024-11-05T15:16:07.000Z","dependencies_parsed_at":"2022-11-05T07:15:15.116Z","dependency_job_id":null,"html_url":"https://github.com/InitPHP/Redis","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InitPHP%2FRedis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InitPHP%2FRedis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InitPHP%2FRedis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InitPHP%2FRedis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InitPHP","download_url":"https://codeload.github.com/InitPHP/Redis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244746787,"owners_count":20503264,"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","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":[],"created_at":"2024-11-26T14:15:09.495Z","updated_at":"2026-05-24T11:01:42.725Z","avatar_url":"https://github.com/InitPHP.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## InitPHP Redis Management\r\n\r\n\u003e ## ⚠️ DEPRECATED — No Longer Maintained\r\n\u003e\r\n\u003e This package was a thin convenience wrapper around the PHP `ext-redis` extension, adding prefix handling and automatic `serialize()` of values. As part of the InitPHP package consolidation, **it has been retired:**\r\n\u003e\r\n\u003e - **PHP 8+ ships `ext-redis` with fully typed methods**, so a wrapper adds little over the native API.\r\n\u003e - The automatic `serialize()` adds non-trivial CPU + network overhead and is rarely what callers want today.\r\n\u003e - No package in the InitPHP ecosystem currently depends on this one. (`initphp/cache` and `initphp/sessions` both talk to `\\Redis` directly.)\r\n\u003e\r\n\u003e This repository is kept read-only for historical reference. **No further updates will be released.**\r\n\u003e\r\n\u003e ### What to use instead\r\n\u003e\r\n\u003e Pick the closest match to what you were doing:\r\n\u003e\r\n\u003e **Caching key/value data** — use [`initphp/cache`](https://github.com/InitPHP/Cache) with its bundled Redis handler:\r\n\u003e\r\n\u003e ```php\r\n\u003e use InitPHP\\Cache\\Handler\\Redis as RedisCache;\r\n\u003e\r\n\u003e $cache = new RedisCache([\r\n\u003e     'host' =\u003e '127.0.0.1',\r\n\u003e     'port' =\u003e 6379,\r\n\u003e ]);\r\n\u003e $cache-\u003eset('name', 'muhammet');\r\n\u003e ```\r\n\u003e\r\n\u003e **Storing session data** — use [`initphp/sessions`](https://github.com/InitPHP/Sessions) with its `RedisAdapter`. See the Sessions README for the Redis usage example.\r\n\u003e\r\n\u003e **Anything else** (Pub/Sub, Lua scripts, Cluster, pipelining, low-level Redis commands) — call `\\Redis` directly. It is the canonical, fully-typed entry point and supports the full Redis feature surface:\r\n\u003e\r\n\u003e ```php\r\n\u003e $redis = new \\Redis();\r\n\u003e $redis-\u003econnect('127.0.0.1', 6379);\r\n\u003e $redis-\u003eset('name', 'muhammet');\r\n\u003e $value = $redis-\u003eget('name');\r\n\u003e ```\r\n\u003e\r\n\u003e Composer will surface this package as `abandoned` on `composer require`, `composer update`, and `composer outdated`.\r\n\r\n---\r\n\r\nThis library was born to facilitate and customize the use of getter and setter of PHP and Redis.\r\n\r\n## Requirements\r\n\r\n- PHP 7.4 or later\r\n- PHP Redis Extension\r\n\r\n## Installation\r\n\r\n```\r\ncomposer require initphp/redis\r\n```\r\n\r\n## Usage\r\n\r\n```php\r\nrequire_once \"vendor/autoload.php\";\r\nuse \\InitPHP\\Redis\\Redis;\r\n\r\n// Provide your connection information;\r\n$redis = new Redis([\r\n        'prefix'        =\u003e 'i_',\r\n        'host'          =\u003e '127.0.0.1',\r\n        'password'      =\u003e null,\r\n        'port'          =\u003e 6379,\r\n        'timeout'       =\u003e 0,\r\n        'database'      =\u003e 0,\r\n]);\r\n\r\n// Use Setter and Getter;\r\n$redis-\u003eset('name', 'muhammet');\r\nif($redis-\u003ehas('name')){\r\n    echo $redis-\u003eget('name'); // \"muhammet\"\r\n}\r\n\r\n/**\r\n * or tell the get method what it will \r\n * do if it can't find it, \r\n * or a default value it will return;\r\n */\r\necho $redis-\u003eget('username', 'Undefined'); // \"Undefined\"\r\n\r\necho $redis-\u003eget('surname', function () use ($redis) {\r\n    $value = 'ŞAFAK';\r\n    $redis-\u003eset('surname', $value);\r\n    return $value;\r\n}); // \"ŞAFAK\"\r\n```\r\n\r\n## Credits\r\n\r\n- [Muhammet ŞAFAK](https://www.muhammetsafak.com.tr) \u003c\u003cinfo@muhammetsafak.com.tr\u003e\u003e\r\n\r\n## License\r\n\r\nCopyright \u0026copy; 2022 [MIT License](./LICENSE) \r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finitphp%2Fredis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finitphp%2Fredis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finitphp%2Fredis/lists"}