Overview

Packages

  • Ldap

Classes

  • Horde_Ldap
  • Horde_Ldap_Entry
  • Horde_Ldap_Exception
  • Horde_Ldap_Filter
  • Horde_Ldap_Ldif
  • Horde_Ldap_RootDse
  • Horde_Ldap_Schema
  • Horde_Ldap_Search
  • Horde_Ldap_Util
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Ldap_Schema

Load an LDAP Schema and provide information

This class takes a Subschema entry, parses this information and makes it available in an array. Most of the code has been inspired by perl-ldap( http://perl-ldap.sourceforge.net). You will find portions of their implementation in here.

Copyright 2009 Jan Wagner, Benedikt Hallinger Copyright 2010-2012 Horde LLC (http://www.horde.org/)

Package: Ldap
Category: Horde
License: LGPL-3.0
Author: Jan Wagner wagner@netsols.de
Author: Benedikt Hallinger beni@php.net
Author: Jan Schneider jan@horde.org
Located at Horde/Ldap/Schema.php
Methods summary
public
# __construct( Horde_Ldap $ldap, string $dn = null )

Constructor.

Constructor.

Fetches the Schema from an LDAP connection.

Parameters

$ldap
LDAP connection.
$dn
Subschema entry DN.

Throws

Horde_Ldap_Exception
public array
# getAll( string $type )

Returns a hash of entries for the given type.

Returns a hash of entries for the given type.

Types may be: objectclasses, attributes, ditcontentrules, ditstructurerules, matchingrules, matchingruleuses, nameforms, syntaxes.

Parameters

$type
Type to fetch.

Returns

array

Throws

Horde_Ldap_Exception
public mixed
# get( string $type, string $name )

Returns a specific entry.

Returns a specific entry.

Parameters

$type
Type of name.
$name
Name or OID to fetch.

Returns

mixed

Throws

Horde_Ldap_Exception
public array
# may( string $oc, boolean $checksup = false )

Fetches attributes that MAY be present in the given objectclass.

Fetches attributes that MAY be present in the given objectclass.

Parameters

$oc
Name or OID of objectclass.
$checksup
Check all superiour objectclasses too?

Returns

array
Array with attributes.
public array
# must( string $oc, boolean $checksup = false )

Fetches attributes that MUST be present in the given objectclass.

Fetches attributes that MUST be present in the given objectclass.

Parameters

$oc
Name or OID of objectclass.
$checksup
Check all superiour objectclasses too?

Returns

array
Array with attributes.
public array
# superclass( string $oc )

Returns the name(s) of the immediate superclass(es).

Returns the name(s) of the immediate superclass(es).

Parameters

$oc
Name or OID of objectclass.

Returns

array

Throws

Horde_Ldap_Exception
public
# parse( Horde_Ldap_Entry $entry )

Parses the schema of the given subschema entry.

Parses the schema of the given subschema entry.

Parameters

$entry
Subschema entry.
public boolean
# isBinary( string $attribute )

Returns wether a attribute syntax is binary or not.

Returns wether a attribute syntax is binary or not.

This method is used by Horde_Ldap_Entry to decide which PHP function needs to be used to fetch the value in the proper format (e.g. binary or string).

Parameters

$attribute
The name of the attribute (eg.: 'sn').

Returns

boolean
True if the attribute is a binary type.
Constants summary
string SYNTAX_BOOLEAN

Syntax definitions.

Syntax definitions.

Please don't forget to add binary attributes to isBinary() below to support proper value fetching from Horde_Ldap_Entry.

# '1.3.6.1.4.1.1466.115.121.1.7'
string SYNTAX_DIRECTORY_STRING
# '1.3.6.1.4.1.1466.115.121.1.15'
string SYNTAX_DISTINGUISHED_NAME
# '1.3.6.1.4.1.1466.115.121.1.12'
string SYNTAX_INTEGER
# '1.3.6.1.4.1.1466.115.121.1.27'
string SYNTAX_JPEG
# '1.3.6.1.4.1.1466.115.121.1.28'
string SYNTAX_NUMERIC_STRING
# '1.3.6.1.4.1.1466.115.121.1.36'
string SYNTAX_OID
# '1.3.6.1.4.1.1466.115.121.1.38'
string SYNTAX_OCTET_STRING
# '1.3.6.1.4.1.1466.115.121.1.40'
Properties summary
public array $types

Map of entry types to LDAP attributes of subschema entry.

Map of entry types to LDAP attributes of subschema entry.

# array( 'attribute' => 'attributeTypes', 'ditcontentrule' => 'dITContentRules', 'ditstructurerule' => 'dITStructureRules', 'matchingrule' => 'matchingRules', 'matchingruleuse' => 'matchingRuleUse', 'nameform' => 'nameForms', 'objectclass' => 'objectClasses', 'syntax' => 'ldapSyntaxes' )
API documentation generated by ApiGen