You are here

public function SimpleLdapConnection::__construct in Simple LDAP 8

Constructs a SimpleLdapConnection.

Parameters

ConfigFactoryInterface $config_factory:

File

src/SimpleLdapConnection.php, line 34

Class

SimpleLdapConnection

Namespace

Drupal\simple_ldap

Code

public function __construct(ConfigFactoryInterface $config_factory) {
  $this->config = $config_factory
    ->get('simple_ldap.server');
  $connection_prefix = $this->config
    ->get('encryption') === 'ssl' ? 'ldaps://' : 'ldap://';
  $this->connection_string = $connection_prefix . $this->config
    ->get('host') . ':' . $this->config
    ->get('port');
}