connect($host, $port, 5); } else { $connect = @$redis->connect($redis_sock); } if ($connect){ if (!empty($redis_auth)){ $auth = $redis->auth($redis_auth); if (!$auth){ $flux['data']['message_erreur'] = _T('memoization:redis_erreur_password'); } } if (empty($flux['data']['message_erreur']) and is_int($redis_dbindex)){ $test = $redis->select($redis_dbindex); if (!$test){ $flux['data']['message_erreur'] = _T('memoization:redis_erreur_database'); } } if ($flux['data']['message_erreur']){ try { $ping = $redis->ping(); } catch (Exception $e) { $flux['data']['message_erreur'] = _T('memoization:redis_erreur_connexion') . ": " . $e->getMessage(); } } } else { $flux['data']['message_erreur'] = _T('memoization:redis_erreur_connexion'); } } } return $flux; }