1
1
# clue/redis-server [ ![ Build Status] ( https://travis-ci.org/clue/php-redis-server.svg?branch=master )] ( https://travis-ci.org/clue/php-redis-server )
2
2
3
- A redis server implementation in pure PHP. * Not for the faint-hearted.*
3
+ A Redis server implementation in pure PHP. * Not for the faint-hearted.*
4
4
5
5
> Note: This project is in early alpha stage! Feel free to report any issues you encounter.
6
6
7
7
## Introduction
8
8
9
-
10
9
### Motivation
11
10
12
- This project aims to provide a simple alternative to the official redis server
11
+ [ Redis] ( http://redis.io/ ) is a fast in-memory key-value database.
12
+ This project aims to provide a simple alternative to the official Redis server
13
13
implementation if installing it is not an option.
14
14
15
- Why would I use this project if I already have the official redis server
15
+ Why would I use this project if I already have the official Redis server
16
16
installed? Simply put, you wouldn't. Ever.
17
17
18
18
### Project goals
19
19
20
- * ✓ Implement an in-memory datastore using the redis protocol
21
- * ✓ Compatiblity with common redis clients
20
+ * ✓ Implement an in-memory datastore using the Redis protocol
21
+ * ✓ Compatiblity with common Redis clients and tools
22
22
* ✓ redis-cli
23
23
* ✓ redis-benchmark
24
24
* ✓ SOLID and modern design, tested and modular components
25
25
* ✗ Implement * all* commands (see below for list of supported commands)
26
- * ✗ Compatibility with common tools resque(-php) etc.
27
26
28
27
### Supported commands
29
28
30
29
Eventually, this project aims to replicate * all* commands of
31
- the [ official redis server] ( http://redis.io/ ) implementation and their exact
30
+ the [ official Redis server] ( http://redis.io/ ) implementation and their exact
32
31
behavior.
33
32
34
33
So far, the following list of commands shows what's already implemented:
@@ -98,21 +97,21 @@ So far, the following list of commands shows what's already implemented:
98
97
* TIME
99
98
100
99
For details, refer to the excellent official documentation of
101
- [ redis commands] ( http://redis.io/commands ) .
100
+ [ Redis commands] ( http://redis.io/commands ) .
102
101
103
102
All available commands are expected to behave just like their counterparts in
104
- redis v2.6, unless otherwise noted. If you find a command to misbehave, don't
103
+ Redis v2.6+ , unless otherwise noted. If you find a command to misbehave, don't
105
104
hesitate to file a bug.
106
105
107
106
Obviously, this list is incomplete in that it does not include * every* command
108
- supported by redis . If you find a command is missing, please submit a PR :)
107
+ supported by Redis . If you find a command is missing, please submit a PR :)
109
108
110
109
### Benchmarking performance
111
110
112
111
> As usual, just about * every* benchmark is biased - you've been warned.
113
112
114
113
You can use the ` redis-benchmark ` script that is included when installing the
115
- official redis server.
114
+ official Redis server.
116
115
117
116
``` bash
118
117
$ redis-benchmark -p 1337 -q
@@ -154,7 +153,7 @@ performance:
154
153
Disabled debugging output significantly improves performance (3x)
155
154
- The benchmark should not be run from within a virtual machine. Running this on
156
155
the host machine instead shows significant improvements (8x). For comparision,
157
- the same applies to official redis , although it shows a smaller impact (3x).
156
+ the same applies to official Redis , although it shows a smaller impact (3x).
158
157
159
158
## Quickstart example
160
159
@@ -168,8 +167,7 @@ Alternatively, you can also use this project as a lib in order to build your
168
167
own server like this:
169
168
170
169
``` php
171
-
172
- $factory = new Factory($loop, $connector);
170
+ $factory = new Factory($loop);
173
171
$factory->createServer('localhost:1337')->then(function (Server $server) use ($loop) {
174
172
$server->on('connection', function(Client $client) {
175
173
echo $client->getRemoteAddr() .' connected' . PHP_EOL;
@@ -186,8 +184,8 @@ its dependencies [through composer](http://getcomposer.org). [New to composer?](
186
184
187
185
``` bash
188
186
$ sudo apt-get install php5-cli git curl
189
- $ git clone https://github.com/clue/redis-server.git
190
- $ cd redis-server/
187
+ $ git clone https://github.com/clue/php- redis-server.git
188
+ $ cd php- redis-server/
191
189
$ curl -s https://getcomposer.org/installer | php
192
190
$ php composer.phar install
193
191
```
@@ -204,4 +202,3 @@ $ docker run -d clue/php-redis-server
204
202
## License
205
203
206
204
MIT
207
-
0 commit comments