File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed 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 must be installed ' );
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