Zend provides an API for DN manipulation.
More...
|
| getRdn ($caseFold=null) |
| Gets the RDN of the current DN.
|
|
| getRdnString ($caseFold=null) |
| Gets the RDN of the current DN as a string.
|
|
| getParentDn ($levelUp=1) |
| Get the parent DN $levelUp levels up the tree.
|
|
| get ($index, $length=1, $caseFold=null) |
| Get a DN part.
|
|
| set ($index, array $value) |
| Set a DN part.
|
|
| remove ($index, $length=1) |
| Remove a DN part.
|
|
| append (array $value) |
| Append a DN part.
|
|
| prepend (array $value) |
| Prepend a DN part.
|
|
| insert ($index, array $value) |
| Insert a DN part.
|
|
| setCaseFold ($caseFold) |
| Sets the case fold.
|
|
| toString ($caseFold=null) |
| Return DN as a string.
|
|
| toArray ($caseFold=null) |
| Return DN as an array.
|
|
| __toString () |
| Cast to string representation {.
|
|
| offsetExists ($offset) |
| Required by the ArrayAccess implementation.
|
|
| offsetGet ($offset) |
| Proxy to {.
|
|
| offsetSet ($offset, $value) |
| Proxy to {.
|
|
| offsetUnset ($offset) |
| Proxy to {.
|
|
|
static | factory ($dn, $caseFold=null) |
| Creates a DN from an array or a string.
|
|
static | fromString ($dn, $caseFold=null) |
| Creates a DN from a string.
|
|
static | fromArray (array $dn, $caseFold=null) |
| Creates a DN from an array.
|
|
static | setDefaultCaseFold ($caseFold) |
| Sets the default case fold.
|
|
static | escapeValue ($values=array()) |
| Escapes a DN value according to RFC 2253.
|
|
static | unescapeValue ($values=array()) |
| Undoes the conversion done by escapeValue().
|
|
static | explodeDn ($dn, array &$keys=null, array &$vals=null, $caseFold=self::ATTR_CASEFOLD_NONE) |
| Creates an array containing all parts of the given DN.
|
|
static | checkDn ($dn, array &$keys=null, array &$vals=null, $caseFold=self::ATTR_CASEFOLD_NONE) |
|
static | implodeRdn (array $part, $caseFold=null) |
| Returns a DN part in the form $attribute = $value.
|
|
static | implodeDn (array $dnArray, $caseFold=null, $separator= ',') |
| Implodes an array in the form delivered by explodeDn() to a DN string.
|
|
static | isChildOf ($childDn, $parentDn) |
| Checks if given $childDn is beneath $parentDn subtree.
|
|
|
static | assertRdn (array $value) |
| Assert if value is in a correct RDN format.
|
|
static | caseFoldRdn (array $part, $caseFold) |
| Do a case folding on a RDN.
|
|
static | caseFoldDn (array $dn, $caseFold) |
| Do a case folding on a DN ort part of it.
|
|
static | sanitizeCaseFold ($caseFold, $default) |
| Sanitizes the case fold.
|
|
Zend provides an API for DN manipulation.
__construct |
( |
array |
$dn, |
|
|
|
$caseFold |
|
) |
| |
|
protected |
Constructor.
- Parameters
-
array | $dn | |
string | null | $caseFold | |
Cast to string representation {.
- See Also
- toString()}
- Returns
- string
Append a DN part.
- Parameters
-
- Returns
- Dn Provides a fluent interface
Assert index is correct and usable.
- Parameters
-
- Returns
- bool
- Exceptions
-
static assertRdn |
( |
array |
$value | ) |
|
|
staticprotected |
Assert if value is in a correct RDN format.
- Parameters
-
- Returns
- bool
- Exceptions
-
static caseFoldDn |
( |
array |
$dn, |
|
|
|
$caseFold |
|
) |
| |
|
staticprotected |
Do a case folding on a DN ort part of it.
- Parameters
-
- Returns
- array
static caseFoldRdn |
( |
array |
$part, |
|
|
|
$caseFold |
|
) |
| |
|
staticprotected |
Do a case folding on a RDN.
- Parameters
-
array | $part | |
string | $caseFold | |
- Returns
- array
static checkDn |
( |
|
$dn, |
|
|
array & |
$keys = null , |
|
|
array & |
$vals = null , |
|
|
|
$caseFold = self::ATTR_CASEFOLD_NONE |
|
) |
| |
|
static |
- Parameters
-
string | $dn | The DN to parse |
array | $keys | An optional array to receive DN keys (e.g. CN, OU, DC, ...) |
array | $vals | An optional array to receive DN values |
string | $caseFold | |
- Returns
- bool True if the DN was successfully parsed or false if the string is not a valid DN.
static escapeValue |
( |
|
$values = array() | ) |
|
|
static |
Escapes a DN value according to RFC 2253.
Escapes the given VALUES according to RFC 2253 so that they can be safely used in LDAP DNs. The characters ",", "+", """, "", "<", ">", ";", "#", " = " with a special meaning in RFC 2252 are preceded by ba backslash. Control characters with an ASCII code < 32 are represented as . Finally all leading and trailing spaces are converted to sequences of \20.
- See Also
- Net_LDAP2_Util::escape_dn_value() from Benedikt Hallinger beni@.nosp@m.php..nosp@m.net Benedikt Hallinger beni@.nosp@m.php..nosp@m.net string|array $values An array containing the DN values that should be escaped array The array $values, but escaped
static explodeDn |
( |
|
$dn, |
|
|
array & |
$keys = null , |
|
|
array & |
$vals = null , |
|
|
|
$caseFold = self::ATTR_CASEFOLD_NONE |
|
) |
| |
|
static |
Creates an array containing all parts of the given DN.
Array will be of type array( array("cn" => "name1", "uid" => "user"), array("cn" => "name2"), array("dc" => "example"), array("dc" => "org") ) for a DN of cn=name1+uid=user,cn=name2,dc=example,dc=org.
- Parameters
-
string | $dn | |
array | $keys | An optional array to receive DN keys (e.g. CN, OU, DC, ...) |
array | $vals | An optional array to receive DN values |
string | $caseFold | |
- Returns
- array
- Exceptions
-
static factory |
( |
|
$dn, |
|
|
|
$caseFold = null |
|
) |
| |
|
static |
Creates a DN from an array or a string.
- Parameters
-
string | array | $dn | |
string | null | $caseFold | |
- Returns
- Dn
- Exceptions
-
static fromArray |
( |
array |
$dn, |
|
|
|
$caseFold = null |
|
) |
| |
|
static |
Creates a DN from an array.
- Parameters
-
array | $dn | |
string | null | $caseFold | |
- Returns
- Dn
- Exceptions
-
static fromString |
( |
|
$dn, |
|
|
|
$caseFold = null |
|
) |
| |
|
static |
Creates a DN from a string.
- Parameters
-
string | $dn | |
string | null | $caseFold | |
- Returns
- Dn
- Exceptions
-
get |
( |
|
$index, |
|
|
|
$length = 1 , |
|
|
|
$caseFold = null |
|
) |
| |
Get a DN part.
- Parameters
-
int | $index | |
int | $length | |
string | $caseFold | |
- Returns
- array
- Exceptions
-
Exception\LdapException | if index is illegal |
getParentDn |
( |
|
$levelUp = 1 | ) |
|
Get the parent DN $levelUp levels up the tree.
- Parameters
-
- Exceptions
-
- Returns
- Dn
getRdn |
( |
|
$caseFold = null | ) |
|
Gets the RDN of the current DN.
- Parameters
-
- Returns
- array
- Exceptions
-
Exception\LdapException | if DN has no RDN (empty array) |
getRdnString |
( |
|
$caseFold = null | ) |
|
Gets the RDN of the current DN as a string.
- Parameters
-
- Returns
- string
- Exceptions
-
Exception\LdapException | if DN has no RDN (empty array) |
static implodeDn |
( |
array |
$dnArray, |
|
|
|
$caseFold = null , |
|
|
|
$separator = ',' |
|
) |
| |
|
static |
Implodes an array in the form delivered by explodeDn() to a DN string.
$dnArray must be of type array( array("cn" => "name1", "uid" => "user"), array("cn" => "name2"), array("dc" => "example"), array("dc" => "org") )
- Parameters
-
array | $dnArray | |
string | $caseFold | |
string | $separator | |
- Returns
- string
- Exceptions
-
static implodeRdn |
( |
array |
$part, |
|
|
|
$caseFold = null |
|
) |
| |
|
static |
Returns a DN part in the form $attribute = $value.
This method supports the creation of multi-valued RDNs $part must contain an even number of elements.
- Parameters
-
array | $part | |
string | $caseFold | |
- Returns
- string
- Exceptions
-
insert |
( |
|
$index, |
|
|
array |
$value |
|
) |
| |
Insert a DN part.
- Parameters
-
- Returns
- Dn Provides a fluent interface
- Exceptions
-
Exception\LdapException | if index is illegal |
static isChildOf |
( |
|
$childDn, |
|
|
|
$parentDn |
|
) |
| |
|
static |
Checks if given $childDn is beneath $parentDn subtree.
- Parameters
-
string | Dn | $childDn | |
string | Dn | $parentDn | |
- Returns
- bool
Required by the ArrayAccess implementation.
- Parameters
-
- Returns
- bool
Proxy to {.
- See Also
- get()} Required by the ArrayAccess implementation
- Parameters
-
- Returns
- array
offsetSet |
( |
|
$offset, |
|
|
|
$value |
|
) |
| |
Proxy to {.
- See Also
- set()} Required by the ArrayAccess implementation
- Parameters
-
Proxy to {.
- See Also
- remove()} Required by the ArrayAccess implementation
- Parameters
-
Prepend a DN part.
- Parameters
-
- Returns
- Dn Provides a fluent interface
remove |
( |
|
$index, |
|
|
|
$length = 1 |
|
) |
| |
Remove a DN part.
- Parameters
-
- Returns
- Dn Provides a fluent interface
- Exceptions
-
Exception\LdapException | if index is illegal |
static sanitizeCaseFold |
( |
|
$caseFold, |
|
|
|
$default |
|
) |
| |
|
staticprotected |
Sanitizes the case fold.
- Parameters
-
string | $caseFold | |
string | $default | |
- Returns
- string
set |
( |
|
$index, |
|
|
array |
$value |
|
) |
| |
Set a DN part.
- Parameters
-
- Returns
- Dn Provides a fluent interface
- Exceptions
-
Exception\LdapException | if index is illegal |
Sets the case fold.
- Parameters
-
static setDefaultCaseFold |
( |
|
$caseFold | ) |
|
|
static |
Sets the default case fold.
- Parameters
-
toArray |
( |
|
$caseFold = null | ) |
|
Return DN as an array.
- Parameters
-
- Returns
- array
toString |
( |
|
$caseFold = null | ) |
|
Return DN as a string.
- Parameters
-
- Returns
- string
- Exceptions
-
static unescapeValue |
( |
|
$values = array() | ) |
|
|
static |
$defaultCaseFold = self::ATTR_CASEFOLD_NONE |
|
staticprotected |
const ATTR_CASEFOLD_LOWER = 'lower' |
const ATTR_CASEFOLD_NONE = 'none' |
const ATTR_CASEFOLD_UPPER = 'upper' |