src/LdapTools/Connection/LdapServerPool.php
protected function getServersFromDns()
    {
        $servers = $this->dns->getRecord(LdapUtilities::SRV_PREFIX.$this->config->getDomainName(), DNS_SRV);

        if ($servers === false || empty($servers)) {
            throw new LdapConnectionException(sprintf(
                'No LDAP servers found via DNS for "%s".',
                $this->config->getDomainName()
            ));
        }
        array_multisort(
            array_column($servers, 'pri'), SORT_ASC|SORT_NUMERIC,
            array_column($servers, 'weight'), SORT_DESC|SORT_NUMERIC,
            $servers
        );

        return array_column($servers, 'target');
    }
protected function getServersFromDns()
    {
        $servers = $this->dns->getRecord(LdapUtilities::SRV_PREFIX.$this->config->getDomainName(), DNS_SRV);

        if ($servers === false || empty($servers)) {
            throw new LdapConnectionException(sprintf(
                'No LDAP servers found via DNS for "%s".',
                $this->config->getDomainName()
            ));
        }
        array_multisort(
            array_column($servers, 'pri'), SORT_ASC|SORT_NUMERIC,
            array_column($servers, 'weight'), SORT_DESC|SORT_NUMERIC,
            $servers
        );

        return array_column($servers, 'target');
    }
protected function getServersFromDns ( ) { $ servers = $ this -> dns -> getRecord ( LdapUtilities :: SRV_PREFIX . $ this -> config -> getDomainName ( ) , DNS_SRV ) ; if ( $ servers === false || empty ( $ servers ) ) { throw new LdapConnectionException ( sprintf ( 'No LDAP servers found via DNS for "%s".' , $ this -> config -> getDomainName ( ) ) ) ; } array_multisort ( array_column ( $ servers , 'pri' ) , SORT_ASC | SORT_NUMERIC , array_column ( $ servers , 'weight' ) , SORT_DESC | SORT_NUMERIC , $ servers ) ; return array_column ( $ servers , 'target' ) ; }
Attempt to lookup the LDAP servers from the DNS name.

@return array The LDAP servers.
@throws LdapConnectionException
Attempt to lookup the LDAP servers from the DNS name .