Adldap\Connections\ConnectionInterface::connect PHP Method

connect() public method

Connects to the specified hostname using the specified port.
public connect ( string | array $hostname = [], integer $port = 389 ) : mixed
$hostname string | array
$port integer
return mixed
    public function connect($hostname = [], $port = 389);

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 public function setConnection(ConnectionInterface $connection = null)
 {
     // We'll create a standard connection if one isn't given.
     $this->connection = $connection ?: new Ldap();
     // Prepare the connection.
     $this->prepareConnection();
     // Instantiate the LDAP connection.
     $this->connection->connect($this->configuration->get('domain_controllers'), $this->configuration->get('port'));
     return $this;
 }
All Usage Examples Of Adldap\Connections\ConnectionInterface::connect