New Zenner
- Join Date:
- Oct 2005
- Location:
- Kent, UK
- Posts:
- 15
- Plugin Contributions:
- 0
Post #1 by matt_t_hat
I'm guessing this is a wish list rather than code suggest so I'll post it here.
I suggest a Call Back system that would allow modules/plugins/extentions/what-ever-you-want-to-call-them to hook into every pat of the system safely and without harm.
Upgrades would require a simple process without diffs and changes would require no modification at all.
There is a PEAR module/class for this already as I understand it and it is used by NucleusCMS BLOG:CMS and a few other CMSish type jobies.
The idea is that our modules subscribe to events such as PostAddToCart, PreCreateUser, PostCreateUser, PostLogin, PreRenderPage and soforth.
A central class, lets call it EventManager is called something like $Manager->NewEvent("RenderSideBar", &$data);
Where $data is all the data about to be used, o just used etc. The manager would then call each subscribed plugin class summoning it's event like say CallUserFunction("Event_" . $EventName);
This would hand control to any plugins at the appropriate point in the code.
With even a reasonable selection of events it becomes increasingly unlikely that anyone need actually edit the base distro to add new functionality.
Further more it would be easy with a Zen like easiness to add or remove extra functionility.
Even more efficiently lessor used parts could be removed from core to a plugin and the plugin distributed with the distro thus removing nothing fromt he code base while simplifying and slimlining the core.
My feeling is that this would make Zen Cart accessable to more people, upgrades simpler and add-on writting more inviting.
Surely this can only be good.
--[ Lord Matt ]-----[ Mad, Bad and Nice to know ]-----[ Lord Matt Blog ]--