# Method Protocols.LDAP.parse_ldap_url()

Method parse_ldap_url

  ``mapping`(`string`:`mixed`) parse_ldap_url(`string` `ldap_url`)`

Description

  Parses an LDAP URL and returns its fields in a mapping.

Returns

  The returned mapping contains these fields:

  ``scheme` : `string`` | The URL scheme, either `"ldap"` or `"ldaps"`.
  ``host` : `string`` | Self-explanatory.
  ``port` : `int``
  ``basedn` : `string``
  ``attributes` : `array`(`string`)` | Array containing the attributes. Undefined if none was specified.
  ``scope` : `int`` | The scope as one of the `SEARCH_*` constants. Undefined if none was specified.
  ``filter` : `string`` | The search filter. Undefined if none was specified.
  ``ext` : `mapping`(`string`:`string`|`int(1..1)`)` | The extensions. Undefined if none was specified. The mapping values are `1` for extensions without values. Critical extensions are checked and the leading `"!"` do not remain in the mapping indices.
  ``url` : `string`` | The original unparsed URL.

See also

  `get_parsed_url`