File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 33namespace Clowdy \Cache ;
44
55use Illuminate \Cache \MemcachedConnector as IlluminateMemcachedConnector ;
6+ use RuntimeException ;
67
78class MemcachedConnector extends IlluminateMemcachedConnector
89{
@@ -21,8 +22,8 @@ public function connect(array $config)
2122
2223 // Check and set Elasticache options here
2324 if (array_get ($ config , 'elasticache ' , false )) {
24- if (defined (' \Memcached ::OPT_CLIENT_MODE ' ) && defined (' \Memcached ::DYNAMIC_CLIENT_MODE ' )) {
25- $ memcached ->setOption (\Memcached ::OPT_CLIENT_MODE , \Memcached ::DYNAMIC_CLIENT_MODE );
25+ if (defined (get_class ( $ memcached ). ' ::OPT_CLIENT_MODE ' ) && defined (get_class ( $ memcached ). ' ::DYNAMIC_CLIENT_MODE ' )) {
26+ $ memcached ->setOption (constant ( get_class ( $ memcached ). ' ::OPT_CLIENT_MODE ' ), constant ( get_class ( $ memcached ). ' ::DYNAMIC_CLIENT_MODE ' ) );
2627 }
2728 }
2829
@@ -39,7 +40,7 @@ public function connect(array $config)
3940 }
4041
4142 if ($ memcached ->getVersion () === false ) {
42- throw new \ RuntimeException ('Could not establish Memcached connection. ' );
43+ throw new RuntimeException ('Could not establish Memcached connection. ' );
4344 }
4445
4546 return $ memcached ;
You can’t perform that action at this time.
0 commit comments