first(); return self::$nodes[$id]; } /** * Returns a Guzzle Client for the node in question. * * @param int $node * @return \GuzzleHttp\Client */ public static function guzzleRequest($node) { // The Guzzle Client is cached already. if (array_key_exists($node, self::$guzzle)) { return self::$guzzle[$node]; } $nodeData = self::getByID($node); // @TODO: Better solution to disabling verification. Security risk. self::$guzzle[$node] = new Client([ 'base_uri' => sprintf('%s://%s:%s/', $nodeData->scheme, $nodeData->fqdn, $nodeData->daemonListen), 'timeout' => 10.0, 'connect_timeout' => 5.0, ]); return self::$guzzle[$node]; } }