Skip to content

Commit

Permalink
Fix docs (#52)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>
  • Loading branch information
luizcmarin and vjik authored May 16, 2024
1 parent f4b2b88 commit be00aab
Show file tree
Hide file tree
Showing 20 changed files with 159 additions and 259 deletions.
53 changes: 14 additions & 39 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
Yii DB Redis extension Change Log
==========================================
# Yii DB Redis extension Change Log

2.0.9 under development
-----------------------
## 2.0.9 under development

- no changes in this release.


2.0.8 March 20, 2018
--------------------
## 2.0.8 March 20, 2018

- Bug #141: Calling ActiveQuery::indexBy() had no effect since Yii 2.0.14 (cebe)
- Bug: (CVE-2018-8073): Fix possible remote code execution when improperly filtered user input is passed to `ActiveRecord::findOne()` and `::findAll()` (cebe)
- Enh #66: Cache component can be configured to read / get from replicas (ryusoft)


2.0.7 December 11, 2017
-----------------------
## 2.0.7 December 11, 2017

- Bug #114: Fixed ActiveQuery `not between` and `not` conditions which where not working correctly (cebe, ak1987)
- Bug #123: Fixed ActiveQuery to work with negative limit values, which are used in ActiveDataProvider for the count query (cebe)
Expand All @@ -25,9 +19,7 @@ Yii DB Redis extension Change Log
- Enh #106: Improved handling of connection errors and introduced `yii\redis\SocketException` for these (cebe)
- Chg #127: Added PHP 7.2 compatibility (brandonkelly)


2.0.6 April 05, 2017
--------------------
## 2.0.6 April 05, 2017

- Bug #44: Remove quotes from numeric parts of composite key to avoid problem with different hashes for the same record (uniserpl)
- Bug #67: Fixed regression from 2.0.5, reconnecting a closed connection fails (cebe)
Expand All @@ -40,9 +32,7 @@ Yii DB Redis extension Change Log
- Enh #103: Added missing commands and `@method` documentation for redis commands (cebe)
- Enh: Optimized find by PK for relational queries and IN condition (cebe, andruha)


2.0.5 March 17, 2016
--------------------
## 2.0.5 March 17, 2016

- Bug #22: Fixed string escaping issue in LuaScriptBuilder (vistart)
- Bug #37: Fixed detection of open socket (mirocow)
Expand All @@ -51,49 +41,35 @@ Yii DB Redis extension Change Log
- Chg #14: Added missing `BLPOP` command to `$redisCommands` (samdark)
- Chg #61: Added missing `GEO*` commands to `$redisCommands` (leadermt)


2.0.4 May 10, 2015
------------------
## 2.0.4 May 10, 2015

- Enh #8: Auto increment value was not updated when a primary key was explicitly set (cebe, andruha)


2.0.3 March 01, 2015
--------------------
## 2.0.3 March 01, 2015

- no changes in this release.


2.0.2 January 11, 2015
----------------------
## 2.0.2 January 11, 2015

- Bug #6547: Fixed redis connection to deal with large data in combination with `mget()` (pyurin)


2.0.1 December 07, 2014
-----------------------
## 2.0.1 December 07, 2014

- Bug #4745: value of simple string returns was ignored by redis client and `true` is returned instead, now only `OK` will result in a `true` while all other values are returned as is (cebe)
- Enh #3714: Added support for connecting to redis server using a unix socket (savvot, robregonm)


2.0.0 October 12, 2014
----------------------
## 2.0.0 October 12, 2014

- no changes in this release.


2.0.0-rc September 27, 2014
---------------------------
## 2.0.0-rc September 27, 2014

- Bug #1311: Fixed storage and finding of `null` and boolean values (samdark, cebe)
- Enh #3520: Added `unlinkAll()`-method to active record to remove all records of a model relation (NmDimas, samdark, cebe)
- Enh #4048: Added `init` event to `ActiveQuery` classes (qiangxue)
- Enh #4086: changedAttributes of afterSave Event now contain old values (dizews)


2.0.0-beta April 13, 2014
-------------------------
## 2.0.0-beta April 13, 2014

- Bug #1993: afterFind event in AR is now called after relations have been populated (cebe, creocoder)
- Enh #1773: keyPrefix property of Session and Cache is not restricted to alnum characters anymore (cebe)
Expand All @@ -104,7 +80,6 @@ Yii DB Redis extension Change Log
All relational queries are now directly served by `ActiveQuery` allowing to use
custom scopes in relations (cebe)

2.0.0-alpha, December 1, 2013
-----------------------------
## 2.0.0-alpha, December 1, 2013

- Initial release.
6 changes: 3 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

* Redistributions of source code must retain the above copyright
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Yii Software nor the names of its
* Neither the name of Yii Software nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

Expand Down
73 changes: 54 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,44 @@
<p align="center">
<a href="https://redis.io/" target="_blank" rel="external">
<img src="https://download.redis.io/redis.png" height="100px">
<a href="https://github.com/yiisoft" target="_blank">
<img src="https://yiisoft.github.io/docs/images/yii_logo.svg" height="80px" alt="Yii">
</a>
<a href="https://redis.io/" target="_blank">
<img src="https://download.redis.io/redis.png" height="80px" alt="Redis">
</a>
<h1 align="center">Yii DBAL Redis connection</h1>
<br>
</p>

This extension provides the [redis](https://redis.io/) connection support for the [Yii framework](https://www.yiiframework.com).

[![Latest Stable Version](https://poser.pugx.org/yiisoft/db-redis/v/stable.png)](https://packagist.org/packages/yiisoft/db-redis)
[![Total Downloads](https://poser.pugx.org/yiisoft/db-redis/downloads.png)](https://packagist.org/packages/yiisoft/db-redis)
[![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)
[![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)

This extension provides the [redis](https://redis.io/) connection support for the [Yii framework](https://www.yiiframework.com).

It includes a `Cache` and `Session` storage handler and implements the `ActiveRecord` pattern that allows
you to store active records in redis.

## Support version

| PHP | Redis Version | CI-Actions
|:----:|:------------------------:|:---:|
| PHP | Redis Version | CI-Actions |
|-----|---------------|------------|
|**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&url=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)

## Requirements

- Redis version 2.6.12 or higher.
- `Filter` PHP extension.

## Installation

The package could be installed via composer:
The package could be installed with [Composer](https://getcomposer.org):

```shell
composer require yiisoft/db-redis
```

## Configuration
## General usage

Using `yiisoft/composer-config-plugin` automatically get the settings of `EventDispatcherInterface::class` and `LoggerInterface::class`.

Expand Down Expand Up @@ -63,17 +74,48 @@ return [
];
```

## Configuring application

To use this extension, you have to configure the `Yiisoft\Db\Redis\Connection|Connection` class in your application configuration:

```php
return [
//....
'components' => [
'redis' => [
'class' => 'Yiisoft\Db\Redis\Connection',
'hostname' => 'localhost',
'port' => 6379,
'database' => 0,
],
]
];
```

This provides the basic access to redis storage via the `redis` application component:

```php
Yii::$app->redis->set('mykey', 'some value');
echo Yii::$app->redis->get('mykey');
```

See [Yiisoft\Db\Redis\Connection] for a full list of available methods.

## Documentation

- [English](docs/guide/en/README.md)
- [Português - Brasil](docs/guide/pt-BR/readme.md)
- 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)
- [Internals](docs/internals.md)

## Support

If 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.
You may also check out other [Yii Community Resources](https://www.yiiframework.com/community).

## License

The Yii DBAL Redis connection is free software. It is released under the terms of the BSD License.
Please see [`LICENSE`](./LICENSE.md) for more information.

Maintained by [Yii Software](https://www.yiiframework.com/).

## Support the project

[![Open Collective](https://img.shields.io/badge/Open%20Collective-sponsor-7eadf1?logo=open%20collective&logoColor=7eadf1&labelColor=555555)](https://opencollective.com/yiisoft)
Expand All @@ -85,10 +127,3 @@ You may also check out other [Yii Community Resources](https://www.yiiframework.
[![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=flat&logo=telegram)](https://t.me/yii3en)
[![Facebook](https://img.shields.io/badge/facebook-join-1DA1F2?style=flat&logo=facebook&logoColor=ffffff)](https://www.facebook.com/groups/yiitalk)
[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat&logo=slack)](https://yiiframework.com/go/slack)

## License

The Yii DBAL Redis connection is free software. It is released under the terms of the BSD License.
Please see [`LICENSE`](./LICENSE.md) for more information.

Maintained by [Yii Software](https://www.yiiframework.com/).
17 changes: 14 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,23 @@
"type": "library",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/yiisoft/db-redis/issues",
"issues": "https://github.com/yiisoft/db-redis/issues?state=open",
"source": "https://github.com/yiisoft/db-redis",
"forum": "https://www.yiiframework.com/forum/",
"wiki": "https://www.yiiframework.com/wiki/",
"irc": "ircs://irc.libera.chat:6697/yii",
"source": "https://github.com/yiisoft/db-redis"
"chat": "https://t.me/yii3en"
},
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/yiisoft"
},
{
"type": "github",
"url": "https://github.com/sponsors/yiisoft"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
Expand Down Expand Up @@ -57,4 +68,4 @@
"infection/extension-installer": true
}
}
}
}
25 changes: 7 additions & 18 deletions docs/guide/en/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
# Yii Framework Redis Cache, Session and ActiveRecord extension
# Yii Database Redis Cache, Session and ActiveRecord extension

This extension provides the [redis](https://redis.io/) key-value store support for the Yii2 framework.
It includes a `Cache` and `Session` storage handler and implements the `ActiveRecord` pattern that allows
you to store active records in redis.
## General usage

Getting Started
---------------
- [Using the ActiveRecord](usage-ar.md)
- [Using commands directly](usage-commands.md)

* [Installation](installation.md)
## Additional topics

Usage
-----

* [Using the ActiveRecord](usage-ar.md)
* [Using commands directly](usage-commands.md)

Additional topics
-----------------

* [Using the Cache component](topics-cache.md)
* [Using the Session component](topics-session.md)
- [Using the Cache component](topics-cache.md)
- [Using the Session component](topics-session.md)
41 changes: 0 additions & 41 deletions docs/guide/en/installation.md

This file was deleted.

15 changes: 7 additions & 8 deletions docs/guide/en/topics-cache.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Using the Cache component
=========================
# Using the Cache component

To use the `Cache` component, in addition to configuring the connection as described in the [Installation](installation.md) section,
you also have to configure the `cache` component to be [[Yiisoft\Db\Redis\Cache]]:
To use the [Caching Library](https://github.com/yiisoft/cache-redis), in addition to configuring the connection as described in the [Configuring application](../../../README.md#Configuring-application) section,
you also have to configure the `cache` component to be `Yiisoft\Db\Redis\Cache`:

```php
return [
Expand All @@ -16,7 +15,7 @@ return [
];
```

If you only use the redis cache (i.e., not using its ActiveRecord or Session), you can also configure the parameters of the connection within the
If you only use the redis cache (i.e., not using its [ActiveRecord](https://github.com/yiisoft/active-record) or [Session](https://github.com/yiisoft/session)), you can also configure the parameters of the connection within the
cache component (no connection application component needs to be configured in this case):

```php
Expand All @@ -36,13 +35,13 @@ return [
];
```

The cache provides all methods of the [[yii\caching\CacheInterface]]. If you want to access redis specific methods that are not
included in the interface, you can use them via [[Yiisoft\Db\Redis\Cache::$redis]], which is an instance of [[Yiisoft\Db\Redis\Connection]]:
The cache provides all methods of the `yii\caching\CacheInterface`. If you want to access redis specific methods that are not
included in the interface, you can use them via `Yiisoft\Db\Redis\Cache::$redis`, which is an instance of`Yiisoft\Db\Redis\Connection`:

```php
Yii::$app->cache->redis->hset('mykey', 'somefield', 'somevalue');
Yii::$app->cache->redis->hget('mykey', 'somefield');
...
```

See [[Yiisoft\Db\Redis\Connection]] for a full list of available methods.
See `Yiisoft\Db\Redis\Connection` for a full list of available methods.
Loading

0 comments on commit be00aab

Please sign in to comment.