File tree 1 file changed +4
-0
lines changed
Filter options
src/Symfony/Component/Cache/Traits 1 file changed +4
-0
lines changed
Original file line number Diff line number Diff line change 16
16
use Predis \Connection \Aggregate \PredisCluster ;
17
17
use Predis \Connection \Aggregate \RedisCluster ;
18
18
use Predis \Response \Status ;
19
+ use Symfony \Component \Cache \Exception \CacheException ;
19
20
use Symfony \Component \Cache \Exception \InvalidArgumentException ;
20
21
21
22
/**
@@ -108,6 +109,9 @@ public static function createConnection($dsn, array $options = array())
108
109
$ params += $ query ;
109
110
}
110
111
$ params += $ options + self ::$ defaultConnectionOptions ;
112
+ if (null === $ params ['class ' ] && !extension_loaded ('redis ' ) && !class_exists (\Predis \Client::class)) {
113
+ throw new CacheException (sprintf ('Cannot find the "redis" extension, and "predis/predis" is not installed: %s ' , $ dsn ));
114
+ }
111
115
$ class = null === $ params ['class ' ] ? (extension_loaded ('redis ' ) ? \Redis::class : \Predis \Client::class) : $ params ['class ' ];
112
116
113
117
if (is_a ($ class , \Redis::class, true )) {
You can’t perform that action at this time.
0 commit comments