phpBB

Development Wiki

Listeners

From phpBB Development Wiki

Revision as of 10:59, 17 March 2012 by Michaelc (Talk | contribs)

What are listeners?

Listeners are a way of injecting or modifying code without having to edit the file. They are injected into points that we call Events.

Listeners might also be known as hooks.

Why are listeners helpful?

In olympus one of the problems with phpBB was MOD installation was difficult. It required editing files and this could be done manually or you would have to download a tool separation. This made things hard for end users when updating and when installing multiple MODs they could conflict.

In 3.1 one of the aims was to make this easier. As such an installer was included in the core and the events & listeners system was recreated as the previous hooks system didn't fit the requirements of the MOD Authors Community. This means that file edits are no longer needed making MOD creation alot easier.

How do I use a listener?

You would create a file in your extension which would then use the identifier to hook into the code and inject the code you need into the core or modify the data you need. For more information see the Creating_Listeners page