File tree 4 files changed +9
-8
lines changed
4 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 42
42
43
43
before_install :
44
44
- echo "extension = mongodb.so" >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini
45
+ - echo "extension = redis.so" >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini
45
46
46
47
install :
47
48
- rm $HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini;
Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ class PRedis implements Redis
30
30
*/
31
31
public function __construct (array $ config )
32
32
{
33
+ if (false == class_exists (Client::class)) {
34
+ throw new \LogicException ('The package "predis/predis" must be installed. Please run "composer req predis/predis:^1.1" to install it ' );
35
+ }
36
+
33
37
$ this ->options = $ config ['predis_options ' ];
34
38
35
39
$ this ->parameters = [
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ class PhpRedis implements Redis
19
19
*/
20
20
public function __construct (array $ config )
21
21
{
22
+ if (false == class_exists (\Redis::class)) {
23
+ throw new \LogicException ('You must install the redis extension to use phpredis ' );
24
+ }
25
+
22
26
$ this ->config = $ config ;
23
27
}
24
28
Original file line number Diff line number Diff line change @@ -95,16 +95,8 @@ private function createRedis(): Redis
95
95
{
96
96
if (false == $ this ->redis ) {
97
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
-
102
98
$ this ->redis = new PhpRedis ($ this ->config );
103
99
} 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
-
108
100
$ this ->redis = new PRedis ($ this ->config );
109
101
}
110
102
You can’t perform that action at this time.
0 commit comments