You are here

public function SimpleLdapSchema::__construct in Simple LDAP 7

Same name and namespace in other branches
  1. 7.2 SimpleLdapSchema.class.php \SimpleLdapSchema::__construct()

Constructor.

File

./SimpleLdapSchema.class.php, line 29
Class to represent an LDAP server schema.

Class

SimpleLdapSchema
Simple LDAP Schema class.

Code

public function __construct(SimpleLdapServer $server) {
  $this->server = $server;

  // Fallback for broken servers.
  $this->dn = 'cn=Subschema';

  // Load the subschema DN from the server.
  try {
    if (isset($this->server->rootdse['subschemasubentry'])) {
      $this->dn = $this->server->rootdse['subschemasubentry'][0];
    }
  } catch (SimpleLdapException $e) {
  }
}