Example #1
0
 public static function connection()
 {
     if (empty(self::$connection)) {
         $parameters = ["tcp://" . Config::get('database.redis.default.host') . ':' . Config::get('database.redis.default.port')];
         $options = ['cluster' => 'redis'];
         self::$connection = new Client($parameters, $options);
     }
     return self::$connection;
 }
Example #2
0
 public static function connection()
 {
     if (empty(self::$connection)) {
         $parameters = ["tcp://" . env('REDIS_HOST_CLUSTER', '127.0.0.1')];
         $options = ['cluster' => 'redis'];
         self::$connection = new Predis\Client($parameters, $options);
     }
     return self::$connection;
 }