{"id":14966443,"url":"https://github.com/yiisoft/db-redis","last_synced_at":"2025-10-25T12:09:50.737Z","repository":{"id":39860535,"uuid":"143317337","full_name":"yiisoft/db-redis","owner":"yiisoft","description":"Yii DBAL Redis connection","archived":false,"fork":false,"pushed_at":"2023-02-14T07:56:57.000Z","size":112,"stargazers_count":16,"open_issues_count":3,"forks_count":9,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-04-13T23:13:22.106Z","etag":null,"topics":["database","db","hacktoberfest","optionalforframeworkannounce","redis","yii3"],"latest_commit_sha":null,"homepage":"https://www.yiiframework.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yiisoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null},"funding":{"open_collective":"yiisoft","github":["yiisoft"]}},"created_at":"2018-08-02T16:05:17.000Z","updated_at":"2023-11-28T06:29:24.000Z","dependencies_parsed_at":"2023-09-24T12:19:43.675Z","dependency_job_id":null,"html_url":"https://github.com/yiisoft/db-redis","commit_stats":{"total_commits":47,"total_committers":14,"mean_commits":3.357142857142857,"dds":0.6595744680851063,"last_synced_commit":"32020672fa12384a183a7a7479aec6b237361374"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fdb-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fdb-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fdb-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fdb-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yiisoft","download_url":"https://codeload.github.com/yiisoft/db-redis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219869843,"owners_count":16555205,"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":["database","db","hacktoberfest","optionalforframeworkannounce","redis","yii3"],"created_at":"2024-09-24T13:36:23.634Z","updated_at":"2025-10-19T09:31:18.211Z","avatar_url":"https://github.com/yiisoft.png","language":"PHP","readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/yiisoft\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://yiisoft.github.io/docs/images/yii_logo.svg\" height=\"80px\" alt=\"Yii\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://redis.io/\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://download.redis.io/redis.png\" height=\"80px\" alt=\"Redis\"\u003e\n    \u003c/a\u003e\n    \u003ch1 align=\"center\"\u003eYii DBAL Redis connection\u003c/h1\u003e\n    \u003cbr\u003e\n\u003c/p\u003e\n\n[![Latest Stable Version](https://poser.pugx.org/yiisoft/db-redis/v/stable.png)](https://packagist.org/packages/yiisoft/db-redis)\n[![Total Downloads](https://poser.pugx.org/yiisoft/db-redis/downloads.png)](https://packagist.org/packages/yiisoft/db-redis)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yiisoft/db-redis/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/yiisoft/db-redis/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/yiisoft/db-redis/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/yiisoft/db-redis/?branch=master)\n\nThis extension provides the [redis](https://redis.io/) connection support for the [Yii framework](https://www.yiiframework.com).\n\nIt includes a `Cache` and `Session` storage handler and implements the `ActiveRecord` pattern that allows\nyou to store active records in redis.\n\n## Support version\n\n| PHP | Redis Version | CI-Actions |\n|-----|---------------|------------|\n|**7.4 - 8.0**| **4 - 6**|[![Build status](https://github.com/yiisoft/db-redis/workflows/build/badge.svg)](https://github.com/yiisoft/db-redis/actions?query=workflow%3Abuild) [![Mutation testing badge](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Fdb-redis%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/db-redis/master) [![static analysis](https://github.com/yiisoft/db-redis/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/db-redis/actions?query=workflow%3A%22static+analysis%22) [![type-coverage](https://shepherd.dev/github/yiisoft/db-redis/coverage.svg)](https://shepherd.dev/github/yiisoft/db-redis)\n\n## Requirements\n\n- Redis version 2.6.12 or higher.\n- `Filter` PHP extension.\n\n## Installation\n\nThe package could be installed with [Composer](https://getcomposer.org):\n\n```shell\ncomposer require yiisoft/db-redis\n```\n\n## General usage\n\nUsing `yiisoft/composer-config-plugin` automatically get the settings of `EventDispatcherInterface::class` and `LoggerInterface::class`.\n\nDi-Container:\n\n```php\nuse Yiisoft\\Db\\Redis\\Connection as RedisConnection;\n\nreturn [\n    RedisConnection::class =\u003e [\n        '__class' =\u003e RedisConnection::class,\n        'host()' =\u003e [$params['yiisoft/db-redis']['dsn']['host']],\n        'port()' =\u003e [$params['yiisoft/db-redis']['dsn']['port']],\n        'database()' =\u003e [$params['yiisoft/db-redis']['dsn']['database']],\n        'password()' =\u003e [$params['yiisoft/db-redis']['password']]\n    ]\n];\n```\n\nParams.php\n\n```php\nreturn [\n    'yiisoft/db-redis' =\u003e [\n        'dsn' =\u003e [\n            'driver' =\u003e 'redis',\n            'host' =\u003e '127.0.0.1',\n            'database' =\u003e 0,\n            'port' =\u003e 6379\n        ],\n        'password' =\u003e null,\n    ]\n];\n```\n\n## Configuring application\n\nTo use this extension, you have to configure the `Yiisoft\\Db\\Redis\\Connection|Connection` class in your application configuration:\n\n```php\nreturn [\n    //....\n    'components' =\u003e [\n        'redis' =\u003e [\n            'class' =\u003e 'Yiisoft\\Db\\Redis\\Connection',\n            'hostname' =\u003e 'localhost',\n            'port' =\u003e 6379,\n            'database' =\u003e 0,\n        ],\n    ]\n];\n```\n\nThis provides the basic access to redis storage via the `redis` application component:\n\n```php\nYii::$app-\u003eredis-\u003eset('mykey', 'some value');\necho Yii::$app-\u003eredis-\u003eget('mykey');\n```\n\nSee [Yiisoft\\Db\\Redis\\Connection] for a full list of available methods.\n\n## Documentation\n\n- Guide: [English](docs/guide/en/README.md), [日本語](docs/guide/ja/README.md), [Português - Brasil](docs/guide/pt-BR/README.md), [Русский](docs/guide/ru/README.md), [中国人](docs/guide/zh-CN/README.md)\n- [Internals](docs/internals.md)\n\nIf you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place for that.\nYou may also check out other [Yii Community Resources](https://www.yiiframework.com/community).\n\n## License\n\nThe Yii DBAL Redis connection is free software. It is released under the terms of the BSD License.\nPlease see [`LICENSE`](./LICENSE.md) for more information.\n\nMaintained by [Yii Software](https://www.yiiframework.com/).\n\n## Support the project\n\n[![Open Collective](https://img.shields.io/badge/Open%20Collective-sponsor-7eadf1?logo=open%20collective\u0026logoColor=7eadf1\u0026labelColor=555555)](https://opencollective.com/yiisoft)\n\n## Follow updates\n\n[![Official website](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](https://www.yiiframework.com/)\n[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter\u0026logoColor=1DA1F2\u0026labelColor=555555?style=flat)](https://twitter.com/yiiframework)\n[![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=flat\u0026logo=telegram)](https://t.me/yii3en)\n[![Facebook](https://img.shields.io/badge/facebook-join-1DA1F2?style=flat\u0026logo=facebook\u0026logoColor=ffffff)](https://www.facebook.com/groups/yiitalk)\n[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat\u0026logo=slack)](https://yiiframework.com/go/slack)\n","funding_links":["https://opencollective.com/yiisoft","https://github.com/sponsors/yiisoft"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiisoft%2Fdb-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyiisoft%2Fdb-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiisoft%2Fdb-redis/lists"}