Use Observer instead of hooks

216
Enhancement
Pierre
-
3.0
3.0
Plugins
Completed
Normal
Normal
6 years ago
3 years ago
0

Description

Logic hooks doesn't always work that well, in the sense that the code needs to be eval'd and there is only a limited number of functionality that can be added with a single piece of code.

Instead of using logic hooks, use event observers instead, that allows a plugin to be written as an entire class, and on certain events, a function of the class can be called.

Ticket History

6 years and 3 months ago by Jack

I've tried something like this before, the problem is that the function doesn't have access to the variables outside of it self unless they are explicitly passed to it, which would require having to pass any and all variables to each function.

Where as when using eval, the code can access anything and everything.

6 years and 3 months ago by Jack

  • Closed ticket as Closed

5 years and 10 months ago by Jack

  • Reopened ticket as New

5 years and 10 months ago by Jack

  • Closed ticket as Completed
  • Changed custom_field from 0% to 100%

New plugin system uses class methods and functions to execute plugins.