#216 - Use Observer instead of hooks
Type Enhancement
Status Completed
Milestone 3.0
Version 3.0
Component Plugins
Priority Normal
Severity Normal
Owner Pierre
Assigned to -
Reported 12 years ago
Updated 10 years ago
Votes 0
Related tickets
Proposed time
Worked time

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

12 years and 10 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.

Jack closed as Closed 12 years and 9 months ago
Jack reopened as New 12 years and 4 months ago

12 years and 4 months ago by Jack

  • Closed ticket as Completed
  • custom_field 0% 100%

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