'tcp', 'host' => $_ENV['REDIS_HOST'] ?? '127.0.0.1', 'port' => $_ENV['REDIS_PORT'] ?? 6379, 'password' => $_ENV['REDIS_PASSWORD'] ?: null, ]); } catch (Exception $e) { // If Redis fails, we might want to log it or handle gracefully // depending on how critical it is. throw new Exception("Redis Connection Error: " . $e->getMessage()); } } return self::$instance; } }