Skip to content

Commit f308f65

Browse files
committed
Init
0 parents  commit f308f65

File tree

4 files changed

+95
-0
lines changed

4 files changed

+95
-0
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
# Unix-style newlines with a newline ending every file
4+
[*]
5+
end_of_line = lf
6+
insert_final_newline = true
7+
charset = utf-8
8+
9+
[*.php]
10+
indent_style = space
11+
indent_size = 4
12+
trim_trailing_whitespace = true
13+
14+
[*.json]
15+
indent_style = space
16+
indent_size = 2

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/vendor
2+
/composer.lock
3+
*.swp
4+
/.idea

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Redis Cache and Session for Yii2
2+
======================
3+
This extension provides the [redis](http://redis.io/) key-value store support for the [Yii framework 2.0](http://www.yiiframework.com).
4+
5+
It includes a `Cache` and `Session` storage handler in redis.
6+
7+
**<font color="red">Notice: THIS REPO DID NOT SUPPORT ACTIVE RECORD.</font>**
8+
9+
Requirements
10+
------------
11+
12+
- PHP >=5.4.0
13+
- Redis >= 2.6.12
14+
- ext-redis >=2.2.7
15+
- Yii2 ~2.0.4
16+
17+
Installation
18+
------------
19+
20+
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
21+
22+
Either run
23+
24+
```
25+
php composer.phar require --prefer-dist dcb9/yii2-phpredis
26+
```
27+
28+
or add
29+
30+
```json
31+
"dcb9/yii2-phpredis": "~1.0"
32+
```
33+
34+
to the require section of your composer.json.
35+
36+
37+
Configuration
38+
-------------
39+
40+
To use this extension, you have to configure the Connection class in your application configuration:
41+
42+
```php
43+
return [
44+
//....
45+
'components' => [
46+
'redis' => [
47+
'class' => 'dcb9\redis\Connection',
48+
'hostname' => 'localhost',
49+
'port' => 6379,
50+
'database' => 0,
51+
],
52+
]
53+
];
54+
```

composer.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "dcb9/yii2-phpredis",
3+
"description": "yii2 with phpredis",
4+
"minimum-stability": "stable",
5+
"license": "BSD",
6+
"authors": [
7+
{
8+
"name": "Bob Chengbin",
9+
"email": "bob@phpor.me"
10+
}
11+
],
12+
"require": {
13+
"yiisoft/yii2": "~2.0.4",
14+
"ext-redis": ">=2.2.7"
15+
},
16+
"autoload": {
17+
"psr-4": {
18+
"dcb9\\redis\\": ""
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)