-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs folder standardization and other fixes (#50)
- Loading branch information
1 parent
3202067
commit f4b2b88
Showing
36 changed files
with
326 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Yii Framework 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. | ||
|
||
Getting Started | ||
--------------- | ||
|
||
* [Installation](installation.md) | ||
|
||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
Installation | ||
============ | ||
|
||
## Requirements | ||
|
||
At least redis version 2.6.12 is required for all components to work properly. | ||
|
||
## Getting Composer package | ||
|
||
The preferred way to install this extension is through [composer](https://getcomposer.org/download/). | ||
|
||
```shell | ||
composer require --prefer-dist yiisoft/db-redis | ||
``` | ||
|
||
## 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
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]]: | ||
|
||
```php | ||
return [ | ||
//.... | ||
'components' => [ | ||
// ... | ||
'cache' => [ | ||
'class' => 'Yiisoft\Db\Redis\Cache', | ||
], | ||
] | ||
]; | ||
``` | ||
|
||
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 | ||
cache component (no connection application component needs to be configured in this case): | ||
|
||
```php | ||
return [ | ||
//.... | ||
'components' => [ | ||
// ... | ||
'cache' => [ | ||
'class' => 'Yiisoft\Db\Redis\Cache', | ||
'redis' => [ | ||
'hostname' => 'localhost', | ||
'port' => 6379, | ||
'database' => 0, | ||
], | ||
], | ||
] | ||
]; | ||
``` | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Using the Session component | ||
=========================== | ||
|
||
To use the `Session` component, in addition to configuring the connection as described in the [Installation](installation.md) section, | ||
you also have to configure the `session` component to be [[Yiisoft\Db\Redis\Session]]: | ||
|
||
```php | ||
return [ | ||
//.... | ||
'components' => [ | ||
// ... | ||
'session' => [ | ||
'class' => 'Yiisoft\Db\Redis\Session', | ||
], | ||
] | ||
]; | ||
``` | ||
|
||
If you only use redis session (i.e., not using its ActiveRecord or Cache), you can also configure the parameters of the connection within the | ||
session component (no connection application component needs to be configured in this case): | ||
|
||
```php | ||
return [ | ||
//.... | ||
'components' => [ | ||
// ... | ||
'session' => [ | ||
'class' => 'Yiisoft\Db\Redis\Session', | ||
'redis' => [ | ||
'hostname' => 'localhost', | ||
'port' => 6379, | ||
'database' => 0, | ||
], | ||
], | ||
] | ||
]; | ||
``` |
Oops, something went wrong.