@@ -10,30 +10,48 @@ RedisClient is a fast, fully-functional and user-friendly client for Redis, opti
1010- Support TCP/IP and UNIX sockets.
1111- Support __ PubSub__ and __ monitor__ functionallity.
1212- Support __ pipeline__ .
13+ - Support RAW commands as strings ` "SET foo bar" ` or as arrays ` ['SET', 'foo', 'bar'] ` .
1314- Connections to Redis are established lazily by the client upon the first command.
1415- Easy to use with IDE, client has PHPDocs for all supported versions.
16+ - By default, the client works with the latest stable version of Redis.
1517
1618## Usage
1719
1820### Create a new instance of RedisClient
1921``` php
2022<?php
21- require (dirname(__DIR__).'/src/autoloader .php');
22- // or require ('vendor/autoload .php');
23+ require (dirname(__DIR__).'/vendor/autoload .php');
24+ // or require (dirname(__DIR__).'/src/autoloader .php');
2325
2426use RedisClient\RedisClient;
2527use RedisClient\Client\Version\RedisClient2x6;
2628
29+ // Create new Instance for Redis version 2.8.x with config via factory
30+
31+ $Redis = ClientFactory::create([
32+ 'server' => 'tcp://127.0.0.1:6379', // or 'unix:///tmp/redis.sock'
33+ 'timeout' => 2,
34+ 'version' => '2.8.24'
35+ ]);
36+
37+ echo 'RedisClient: '. $Redis->getSupportedVersion() . PHP_EOL;
38+ // RedisClient: 2.8
39+
40+ // Create new instance of client without factory
41+
2742$Redis = new RedisClient([
2843 'server' => 'tcp://127.0.0.1:6379', // or 'unix:///tmp/redis.sock'
2944 'timeout' => 2
3045]);
3146
32- echo 'RedisClient: '. $Redis->getVersion () . PHP_EOL;
47+ echo 'RedisClient: '. $Redis->getSupportedVersion () . PHP_EOL;
3348echo 'Redis: '. $Redis->info('Server')['redis_version'] . PHP_EOL;
3449
50+ // By default, the client works with the latest stable version of Redis.
3551// RedisClient: 3.0
3652// Redis: 3.0.3
53+
54+
3755```
3856### Example
3957Please, see examples here: https://github.com/cheprasov/php-redis-client/tree/master/examples
0 commit comments