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
9494 private function createRedis (): Redis
9595 {
9696 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+
100102 $ this ->redis = new PhpRedis ($ this ->config );
101103 } else {
104+ if (false == class_exists (\Predis \Client::class)) {
105+ throw new \LogicException ('The package Predis must be installed ' );
106+ }
107+
102108 $ this ->redis = new PRedis ($ this ->config );
103109 }
104110
Original file line number Diff line number Diff line change 88 "require" : {
99 "php" : " ^7.1.3" ,
1010 "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"
1312 },
1413 "require-dev" : {
1514 "phpunit/phpunit" : " ~5.4.0" ,
You can’t perform that action at this time.
0 commit comments