Skip to content

Commit 3f66225

Browse files
committed
ICM: Laravel 5.1+ support.
1 parent fff3e72 commit 3f66225

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Mutex.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use NinjaMutex\Lock\MySqlLock;
1010
use NinjaMutex\Lock\PredisRedisLock;
1111
use NinjaMutex\Mutex as Ninja;
12+
use Predis\Client;
1213
use Redis;
1314

1415
class Mutex
@@ -48,7 +49,12 @@ public function getStrategy()
4849

4950
public function getRedisClient()
5051
{
51-
return Redis::connection()->client();
52+
$connection = Redis::connection();
53+
if ($connection instanceof Client) {
54+
return $connection;
55+
}
56+
57+
return $connection->client();
5258
}
5359

5460
public function __call($method, $parameters)

0 commit comments

Comments
 (0)