Download the PHP package heimrichhannot/contao-observer without Composer
On this page you can find all versions of the php package heimrichhannot/contao-observer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download heimrichhannot/contao-observer
More information about heimrichhannot/contao-observer
Files in heimrichhannot/contao-observer
Package contao-observer
Short Description A observer for contao.
License LGPL-3.0-or-later
Homepage https://github.com/heimrichhannot/contao-observer
Informations about the package contao-observer
Observer
A observer for contao. It is currently required by heimrichhannot/contao-collab and provide task creation from a mailbox, or notify task assignees. But it can be extended easily.
Features
The observer is a cron-job module, that checks subjects against given criteria and update attached observers. It structure is based on the observer pattern. We have subjects like a mailbox for example. If a mail with given criteria (for example new mail) will be received, the attached Taskobserver will create a new Task from a given mail (heimrichhannot/contao-collab required).
- Observe a mailbox (php-imap php extension is required)
- Wait for subject age (wait until tstamp of context elapsed given waiting duration)
- Priority handling (manage execution order)
- Observer log
- Observer history: store all already run subject/observer combinations within local history (e.g. will prevent multiple user notification)
Observer manager
The observer manager observes all entities withing the minutely contao cron job. It works within the poor man's minutly cronjob out of the box, or you can call the binary script within you crontab:
Contao 3 without composer:
Contao 3 with composer:
Contao 4:
Make usage within you custom module
Add a new subject
A subject is for example a mailbox, or tasks within a given tasklist, with needed criteria (UNSEEN Mail, unassigned Tasks…).
1. Add the subject to your config.php
2. Add your subject palette to tl_observer.php
You might add custom fields also in here.
3. Create your Subject Object 'MyNamespace\Observer\MySubject'
Must extend HeimrichHannot\Observer\Subject
.
Add a new observer
A observer is for example a notification, that will be send to a given member (for example a task assignee) when a subject with given criteria were found.
1. Add the observer to your config.php
2. Create your Observer Object 'MyNamespace\Observer\MyObserver'
Must extend HeimrichHannot\Observer\Observer
.
The getPalettes Method is required, to make a observer related to multiple given subjects. The key of the array pair must be the subject name and the value should contain all fields, that should be added to the tl_observer.php palette (after the oberserver selection dropdown) for the given subject palette.
All versions of contao-observer with dependencies
contao/core-bundle Version ^3.5.1 || ~4.1
contao-community-alliance/composer-plugin Version ~2.4 || ~3.0
heimrichhannot/contao-tagsinput Version ~2.0
heimrichhannot/contao-haste_plus Version ~1.0
heimrichhannot/contao-notification_center_plus Version ~1.0
php-imap/php-imap Version ~2.0
mtdowling/cron-expression Version ~1.0