Smile\ElasticsuiteCore\Client\ClientFactory::getHosts PHP Method

getHosts() private method

Return hosts config used to connect to the cluster.
private getHosts ( ) : array
return array
    private function getHosts()
    {
        $hosts = [];
        $clientConfiguration = $this->clientConfiguration;
        foreach ($clientConfiguration->getServerList() as $host) {
            list($hostname, $port) = explode(':', $host);
            $currentHostConfig = ['host' => $hostname, 'port' => $port, 'scheme' => $clientConfiguration->getScheme()];
            if ($clientConfiguration->isHttpAuthEnabled()) {
                $currentHostConfig['user'] = $clientConfiguration->getHttpAuthUser();
                $currentHostConfig['pass'] = $clientConfiguration->getHttpAuthPassword();
            }
            $hosts[] = $currentHostConfig;
        }
        return $hosts;
    }