File tree 3 files changed +12
-7
lines changed
3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 29
29
"stomp-php/stomp-php" : " ^4" ,
30
30
"php-http/guzzle6-adapter" : " ^1.1" ,
31
31
"php-http/client-common" : " ^1.7@dev" ,
32
- "richardfullmer/rabbitmq-management-api" : " ^2.0"
32
+ "richardfullmer/rabbitmq-management-api" : " ^2.0" ,
33
+ "predis/predis" : " ^1.1"
33
34
},
34
35
"require-dev" : {
35
36
"phpunit/phpunit" : " ^5.5" ,
48
49
"empi89/php-amqp-stubs" : " *@dev" ,
49
50
"doctrine/doctrine-bundle" : " ~1.2" ,
50
51
"kwn/php-rdkafka-stubs" : " ^1.0.2" ,
51
- "predis/predis" : " ^1.1" ,
52
52
"friendsofphp/php-cs-fixer" : " ^2"
53
53
},
54
54
"autoload" : {
Original file line number Diff line number Diff line change @@ -94,11 +94,17 @@ public function createContext(): Context
94
94
private function createRedis (): Redis
95
95
{
96
96
if (false == $ this ->redis ) {
97
- if (in_array ('predis ' , $ this ->config ['scheme_extensions ' ], true )) {
98
- $ this ->redis = new PRedis ($ this ->config );
99
- } elseif (in_array ('phpredis ' , $ this ->config ['scheme_extensions ' ], true )) {
97
+ if (in_array ('phpredis ' , $ this ->config ['scheme_extensions ' ], true )) {
98
+ if (false == class_exists (\Redis::class)) {
99
+ throw new \LogicException ('You must install the redis extension to use phpredis ' );
100
+ }
101
+
100
102
$ this ->redis = new PhpRedis ($ this ->config );
101
103
} else {
104
+ if (false == class_exists (\Predis \Client::class)) {
105
+ throw new \LogicException ('The package "predis/predis" must be installed. Please run "composer req predis/predis:^1.1" to install it ' );
106
+ }
107
+
102
108
$ this ->redis = new PRedis ($ this ->config );
103
109
}
104
110
Original file line number Diff line number Diff line change 8
8
"require" : {
9
9
"php" : " ^7.1.3" ,
10
10
"queue-interop/queue-interop" : " 0.7.x-dev" ,
11
- "enqueue/dsn" : " 0.9.x-dev" ,
12
- "predis/predis" : " ^1.1"
11
+ "enqueue/dsn" : " 0.9.x-dev"
13
12
},
14
13
"require-dev" : {
15
14
"phpunit/phpunit" : " ~5.4.0" ,
You can’t perform that action at this time.
0 commit comments