getPort() public method

Get the port number to connect to.
public getPort ( ) : integer
return integer
Exemplo n.º 1
0
 /**
  * Check if a LDAP server is up and available.
  *
  * @param string $server
  * @return bool
  */
 protected function isServerAvailable($server)
 {
     $result = $this->tcp->connect($server, $this->config->getPort(), $this->config->getConnectTimeout());
     if ($result) {
         $this->tcp->close();
     }
     return $result;
 }
Exemplo n.º 2
0
 /**
  * Get the LDAP URL to connect to.
  *
  * @param null|string $server
  * @return string[]
  * @throws LdapConnectionException
  */
 protected function getLdapUrl($server = null)
 {
     $server = $server ?: $this->serverPool->getServer();
     $ldapUrl = ($this->config->getUseSsl() ? 'ldaps' : 'ldap') . '://' . $server . ':' . $this->config->getPort();
     return [$ldapUrl, $server];
 }