Download the PHP package gtt/ad-poller without Composer
On this page you can find all versions of the php package gtt/ad-poller. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gtt/ad-poller
More information about gtt/ad-poller
Files in gtt/ad-poller
Package ad-poller
Short Description Polls Active Directory through ldap and dispatches payload using event dispatcher
License MIT
Informations about the package ad-poller
Active Directory Change Poller
This package is PHP implementation of algorithm of polling for changes in Active Directory servers using uSNChanged attribute with additional features allowing custom adjustments for Active Directory fetching processes and changesets handling.
The main usage purpose is to keep you application in sync with Active Directory structure.
Overview
The core concept is to constantly poll Active Directory server and perform incremental fetch to obtain changesets using uSNChanged attribute as an offset. Each poll task run is persisted in database to save the offset and fetch statistics. In case of Active Directory controller swap, server failures or initial run algorithm performs full fetch to obtain the fullset. Received data is subject to deliver to the target application to be handled.
The component consists of three main parts: synchronizer.
Poller
This is a heart of the library and base implementation of original polling algorithm. Uses synchronizer to process obtained changesets.
See Poller implementation for details.
Fetcher
This part is responsible to interact with Active Directory. Allows poller to fetch neccessary metadata from Active Directory and search changesets using zendframework/zend-ldap.
See LdapFetcher implementation for details.
Synchronizer
Synchronizer is about handling datasets received during polling process. Base implementation uses symfony/event-dispatcher to publish changesets/fullset as an Events. For incremental sync there is a IncrementalSyncEvent, for full sync - FullSyncEvent.
See EventSynchronizer implementation for details.
Component provides SynchronizerInterface which allows implementation of your own synchronizer for custom aims.
Setup and usage
Package installation
To install the package use composer:
Database setup
It is possible to generate schema using doctrine console utils. You can clone the repository from scratch, adjust cli-config.php with credentials to your test database and generate init sql:
Application setup
Create poller:
You also can create as many pollers as you want with different settings depending on your needs.
Now you can poll Active Directory permanently (normally using crontab) runing something like this:
There is also console command that represents convenient way to run pollers with pretty output and additional options if you use use symfony/console:
And put into crontab command to run all pollers:
or concrete one:
Framework integration
There is a gtt/ad-poller-bundle which integrates component in Symfony2+ ecosystem
Testing
To run library test suite just clone the repository and execute the following inside:
All versions of ad-poller with dependencies
laminas/laminas-ldap Version ^2.10
symfony/event-dispatcher Version ^2.3|^3.0
doctrine/orm Version ^2.5
symfony/console Version ^2.3|^3.0