What is a "hook"?

Created by Greg
Keywords:
Last updated by:
Greg

NOTE: as PHPDevShell 3.x, hooks are deprecated and no longer supported.

In PHPDS, hooks are a way to make various plugins collaborate without even knowing about each other. The idea is to follow this guidelines :

- a list of hooks is know ahead of time (you can add yours and even submit them to be in the next release) ; each hook is a given point in the execution timeline
- each page have "hooks calls" at the proper point in their code
- a plugin can register to be called at this points

For example, there's a hook named "head", which correspond to the page header. If a plugin register to that hook, it can add a custom header to every page which is gentle enough to call the hook system at the begining of the output.