{"id":13699967,"url":"https://github.com/nrk/phpiredis","last_synced_at":"2025-12-17T07:49:41.725Z","repository":{"id":44925500,"uuid":"1139251","full_name":"nrk/phpiredis","owner":"nrk","description":"PHP extension for Redis based on Hiredis","archived":false,"fork":false,"pushed_at":"2022-01-18T08:06:40.000Z","size":150,"stargazers_count":489,"open_issues_count":9,"forks_count":67,"subscribers_count":33,"default_branch":"v1.1","last_synced_at":"2025-05-04T18:49:52.129Z","etag":null,"topics":["php","phpiredis","redis"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nrk.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}},"created_at":"2010-12-04T23:19:43.000Z","updated_at":"2025-03-04T16:13:35.000Z","dependencies_parsed_at":"2022-08-29T03:00:41.305Z","dependency_job_id":null,"html_url":"https://github.com/nrk/phpiredis","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nrk/phpiredis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrk%2Fphpiredis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrk%2Fphpiredis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrk%2Fphpiredis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrk%2Fphpiredis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nrk","download_url":"https://codeload.github.com/nrk/phpiredis/tar.gz/refs/heads/v1.1","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrk%2Fphpiredis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27779775,"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-12-17T02:00:08.291Z","response_time":55,"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":["php","phpiredis","redis"],"created_at":"2024-08-02T20:00:46.615Z","updated_at":"2025-12-17T07:49:41.710Z","avatar_url":"https://github.com/nrk.png","language":"C","funding_links":[],"categories":["C","客户端"],"sub_categories":[],"readme":"# Phpiredis #\n\n[![Software license][ico-license]](LICENSE)\n[![Build status][ico-travis]][link-travis]\n\nPhpiredis is an extension for PHP 5.x to 8.x based on [hiredis](https://github.com/redis/hiredis)\nthat provides a simple and efficient client for Redis and a fast incremental parser / serializer for\nthe [RESP protocol](http://redis.io/topics/protocol).\n\n## Installation ##\n\nBuilding and using this extension requires `hiredis` (\u003e=0.14, \u003e=1.0) to be installed on the system.\n`hiredis` is usually available in the repositories of most Linux distributions, alternatively it is\npossible to build it by fetching the code from its [repository](https://github.com/redis/hiredis).\n\n```sh\ngit clone https://github.com/nrk/phpiredis.git\ncd phpiredis\nphpize \u0026\u0026 ./configure --enable-phpiredis\nmake \u0026\u0026 make install\n```\n\nWhen the configuration script is unable to locate `hiredis` on your system, you can specify in which\ndirectory it can be found using `--with-hiredis-dir=` (e.g. `--with-hiredis-dir=/usr/local`).\n\nPhpiredis provides a basic test suite that can be launched with `make test`. Tests require a running\ninstance of `redis-server` listening on `127.0.0.1:6379` but __make sure__ that your server does not\nhold data you are interested: you could end up losing everything stored on it!\n\nIf you notice a failing test or a bug, you can contribute by opening a pull request on GitHub or\nsimply file a bug on our [issue tracker](http://github.com/nrk/phpiredis/issues).\n\n## Usage ##\n\nConnecting to Redis is as simple as calling the `phpiredis_connect()` function with a server address\nas the first parameter and an optional port number when the server is listening to a different port\nthan the default `6379`:\n\n```php\n$redis = phpiredis_connect('127.0.0.1', 6379);      // normal connection\n$redis = phpiredis_pconnect('127.0.0.1', 6379);     // persistent connection\n```\n\nAlternatively you can connect to redis using UNIX domain socket connections.\n\n```php\n$redis = phpiredis_connect('/tmp/redis.sock');      // normal connection\n$redis = phpiredis_pconnect('/tmp/redis.sock');     // persistent connection\n```\n\nOnce the connection is established, you can send commands to Redis using `phpiredis_command_bs()` or\npipeline them using `phpiredis_multi_command_bs()`:\n\n```php\n$response = phpiredis_command_bs($redis, array('DEL', 'test'));\n\n$response = phpiredis_multi_command_bs($redis, array(\n    array('SET', 'test', '1'),\n    array('GET', 'test'),\n));\n```\n\nThe `_bs` suffix indicates that these functions can handle binary key names or values by using the\nunified Redis protocol available since Redis \u003e= 1.2.\n\nCommands can still be sent using the old and deprecated inline protocol using `phpiredis_command()`\nand `phpiredis_multi_command()` (note the lack of the `_bs` suffix) but it's highly discouraged and\nthese functions will be removed in future versions of phpiredis.\n\n```php\n$response = phpiredis_command($redis, 'DEL test');\n\n$response = phpiredis_multi_command($redis, array(\n    'SET test 1',\n    'GET test',\n));\n```\n\n## Contributing ##\n\nAny kind of contribution is extremely welcome! Just fork the project on GitHub, work on new features\nor bug fixes using feature branches and [open pull-requests](http://github.com/nrk/phpiredis/issues)\nwith concise but complete descriptions of your changes. If you are unsure about a proposal, you can\njust open an issue to discuss it before writing actual code.\n\n## Authors ##\n\n[Daniele Alessandri](https://github.com/nrk) (current maintainer)\n[Sebastian Waisbrot](https://github.com/seppo0010) (original developer)\n\n## License ##\n\nThe code for phpiredis is distributed under the terms of the BSD license (see [LICENSE](LICENSE)).\n\n[ico-license]: https://img.shields.io/github/license/nrk/phpiredis.svg?style=flat-square\n[ico-travis]: https://img.shields.io/travis/nrk/phpiredis.svg?style=flat-square\n\n[link-travis]: https://travis-ci.org/nrk/phpiredis\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnrk%2Fphpiredis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnrk%2Fphpiredis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnrk%2Fphpiredis/lists"}