{"id":16288889,"url":"https://github.com/lulco/redis-proxy","last_synced_at":"2025-06-28T21:35:55.375Z","repository":{"id":7917979,"uuid":"56860255","full_name":"lulco/redis-proxy","owner":"lulco","description":"Library for creating redis instance depends on application / server possibilities","archived":false,"fork":false,"pushed_at":"2025-03-08T12:20:38.000Z","size":91,"stargazers_count":2,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-08T13:18:09.189Z","etag":null,"topics":["predis","proxy","redis"],"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/lulco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2016-04-22T14:13:36.000Z","updated_at":"2025-03-08T12:20:41.000Z","dependencies_parsed_at":"2024-01-19T16:57:21.905Z","dependency_job_id":"08d0ee92-a944-4ced-8f4e-d0ab0ccbb882","html_url":"https://github.com/lulco/redis-proxy","commit_stats":{"total_commits":48,"total_committers":4,"mean_commits":12.0,"dds":"0.27083333333333337","last_synced_commit":"a210b6d7d95633280c21b78a20286cf3bb43d9cb"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lulco%2Fredis-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lulco%2Fredis-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lulco%2Fredis-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lulco%2Fredis-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lulco","download_url":"https://codeload.github.com/lulco/redis-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244047628,"owners_count":20389206,"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":["predis","proxy","redis"],"created_at":"2024-10-10T19:49:38.885Z","updated_at":"2025-06-28T21:35:55.370Z","avatar_url":"https://github.com/lulco.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redis proxy\nLibrary for creating redis instance depends on application / server possibilities\n\n[![Build Status](https://travis-ci.org/lulco/redis-proxy.svg?branch=master)](https://travis-ci.org/lulco/redis-proxy)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/lulco/redis-proxy/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/lulco/redis-proxy/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/lulco/redis-proxy/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/lulco/redis-proxy/?branch=master)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/614109c1-261a-432a-9a32-50d7138b00c4/mini.png)](https://insight.sensiolabs.com/projects/614109c1-261a-432a-9a32-50d7138b00c4)\n[![Latest Stable Version](https://img.shields.io/packagist/v/lulco/redis-proxy.svg)](https://packagist.org/packages/lulco/redis-proxy)\n[![Total Downloads](https://img.shields.io/packagist/dt/lulco/redis-proxy.svg?style=flat-square)](https://packagist.org/packages/lulco/redis-proxy)\n[![PHP 7 ready](http://php7ready.timesplinter.ch/lulco/redis-proxy/master/badge.svg)](https://travis-ci.org/lulco/redis-proxy)\n\n## Installation\n\n### Composer\nThe fastest way to install Redis proxy is to add it to your project using Composer (http://getcomposer.org/).\n\n1. Install Composer:\n    ```\n    curl -sS https://getcomposer.org/installer | php\n    ```\n1. Require Redis proxy as a dependency using Composer:\n    ```\n    php composer.phar require lulco/redis-proxy\n    ```\n1. Install Redis proxy:\n    ```\n    php composer.phar update\n    ```\n\n## Usage\n### Single redis node\n```php\n$redis = new \\RedisProxy\\RedisProxy($host, $port);\n\n// Call redis methods\n$redis-\u003eselect($database);\n$redis-\u003ehset($key, $field, $value);\n$redis-\u003ehlen($key);\n$redis-\u003ehget($key, $field);\n$redis-\u003ehgetall($key);\n...\n```\n\n### Sentinel\n```php\n$sentinels = [\n    ['host' =\u003e '172.19.0.5', 'port' =\u003e 26379],\n    ['host' =\u003e '172.19.0.6', 'port' =\u003e 26379],\n    ['host' =\u003e '172.19.0.7', 'port' =\u003e 26379],\n];\n$clusterId = 'mymaster';\n\n$redis = new \\RedisProxy\\RedisProxy();\n$redis-\u003esetSentinelConnectionPool($sentinels, $clusterId, $database);\n\n// Call redis methods\n$redis-\u003ehset($key, $field, $value);\n$redis-\u003ehlen($key);\n$redis-\u003ehget($key, $field);\n$redis-\u003ehgetall($key);\n```\n\n### Multi read connection\nRead from multiple redis nodes\nWrite to one master redis node\n```php\n$master = ['host' =\u003e '172.19.0.5', 'port' =\u003e 26379];\n$slaves = [\n    ['host' =\u003e '172.19.0.5', 'port' =\u003e 26379],\n    ['host' =\u003e '172.19.0.6', 'port' =\u003e 26379],\n    ['host' =\u003e '172.19.0.7', 'port' =\u003e 26379],\n];\n$clusterId = 'mymaster';\n\n$redis = new \\RedisProxy\\RedisProxy();\n$redis-\u003esetMultiConnectionPool($master, $slaves);\n```\n\n### Multi write connection\nWrite to multiple master redis nodes\nOptionally read from multiple redis nodes\n```php\n$masters = [\n    ['host' =\u003e '172.19.0.5', 'port' =\u003e 26379],\n    ['host' =\u003e '172.19.0.6', 'port' =\u003e 26379],\n    ['host' =\u003e '172.19.0.7', 'port' =\u003e 26379],\n];\n$slaves = [\n    ['host' =\u003e '172.19.0.5', 'port' =\u003e 26379],\n    ['host' =\u003e '172.19.0.6', 'port' =\u003e 26379],\n    ['host' =\u003e '172.19.0.7', 'port' =\u003e 26379],\n];\n$clusterId = 'mymaster';\n\n$redis = new \\RedisProxy\\RedisProxy();\n$redis-\u003esetMultiWriteConnectionPool($masters, $slaves);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flulco%2Fredis-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flulco%2Fredis-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flulco%2Fredis-proxy/lists"}