Review main Abandoned

46338[WIP][FEATURE] Introduce unified observer for hooks & events

Benni Mack CR 0 V 0 Expert +919 −224 updated 01/03/17, 11:08

Commit message

A new observer class is added to handle all future ways of hooking
into the regular TYPO3 system.

Observer provides three ways of hooking into TYPO3:
- notify()
- modify()
- intercept()

Notify() just pushes information at a certain point to listeners,
whereas modify() explicitly allows to modify exactly one value,
which can also be an object. Modify() expects to return the data
to be modified again.
Intercept() enables a developer to check for various options,
and see if the current value should be enough by a custom
callable() to be given to the Observer.

Listeners can be classic callables, objects, methods, functions etc.

The observer provides a flexible way to also call existing hooks,
making it easy to detect and to deprecate old hooks by, at the same
time, provide an identical possibility to hook into the system.

The observer provides ways to register listeners for notify(), modify()
and intercept(), which can be called during the execution of
ext_localconf.php.

ToDo:
- Add Unit Tests for Observer
- Resolve the ToDos
- Add ordering of hooks
- Add registration of hooks via Configuration/Observer.php
- Maybe provide a way to disable all old hooks for performance reasons

Review

  • Code review CR 0

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V 0

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 7