Download the PHP package paweldecowski/ldap-dn without Composer

On this page you can find all versions of the php package paweldecowski/ldap-dn. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ldap-dn

LDAP DN

LDAP Distinguished Name parsing and manipulation library for PHP.

Packagist Version Travis (.com) Coveralls GitHub

Table of contents

Features

Requirements

Installation

How to use

Parsing DNs and accessing their components

Create a DN object from a string

Back to string representation

Dn class as well as classes representing its components (Rdn, Attribute) implement the __toString method. It means that in string context, they automatically become strings:

Access RDNs by index

Note that Rdns in a Dn object are reversed in relation to the DN string (if read from left to right). In a Dn with n Rdns, the right-most Rdn is at index 0 and the left-most Rdn is at index n-1. This is because it’s more natural and common to have the root object at index 0.

Iterate RDNs

outputs:

Access attributes

If there’s only one instance of a certain attribute, you can get its value directly from the Dn object:

If mulitiple attributes with the specified name are found, a MultipleAttributesReturnedException is thrown.

Multivalued RDNs

Rdns are allowed to have multiple attributes, separated by the + character. You can access them using array dereferencing syntax.

You can also iterate attributes if you don’t know their names.

outputs:

Special characters

Filter by attribute name

Note that even though the result of filter() is a Dn object, it may not be a valid Distinguished Name (for example if you remove the root RDN). This library doesn’t have the knowledge of your LDAP structure, so it can’t ensure validity.

Get the parent DN

Manipulating DNs

Dn, Rdn and Attribute are immutable so all manipulation functions return a new object.

Remove a fragment of a DN

Sometimes you may want to remove a fragment of a DN, for example its base DN.

Constructing DNs

While the main purpose of the library is parsing DNs, you can also construct them.

Most RDNs contain a single attribute, so you can construct them with a shorthand syntax.

Exceptions

AttributeNotFoundException

Thrown if an attribute is not found in an Dn.

DnNotFoundException

Thrown if an Dn cannot be found in another Dn

InvalidAttributeStringException

Thrown if a string representing an attribute is malformed.

MultipleAttributesReturned exception

Thrown when multiple Attributes are returned when exactly 1 was expected.

NotImplementedException

Thrown when an unimplemented method is called.


All versions of ldap-dn with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package paweldecowski/ldap-dn contains the following files

Loading the files please wait ....