Prev |  | Next

### 2.2.3. Hooks

The Phorum core and Phorum modules are interconnected through hooks. Hooks are points in the application where Phorum stops and runs its data through the modules that are configured to handle the hook. The modules can act upon and change this data.

The following image visualizes what happens when Phorum reaches a hook point in the application, for which two modules ("foo" and "bar") have been configured.

`
Phorum
Application
(1) (1) Phorum is running.
| (2) Phorum reaches the
| hook named "some_hook".
v Phorum (3) Phorum sends data to
some_hook >----- data ------+ the module system.
(2) (3) | (4) The module "foo" is run.
v (5) The module "bar" is run.
(4) module "foo" (6) The Phorum data (which
| might be modified by the
v modules) is sent back
(5) module "bar" to Phorum.
| (7) Phorum continues running
Phorum Modified | with the modified data.
Application <---- data ------+
(7) (6)
|
|
v
`

Prev | Up | Next
| Home |