April 27, 2007

plugins

Filed under: ZenMagick — DerManoMann @ 6:15 am

So I have plugins working, right? So what?

Well, as it turned out things were not as simple as I expected (are they ever?). In this case, the fact that a lot of zen-cart logic is file based really slowed me down.

What happens is that in order to make zen-cart believe something is there (for example a sidebox) it really needs a file in a particular directory. I guess this is one of the reasons for the patches that create dummy files in zen-cart directories…

So, with plugins there will be a few more dummy files. As it happens, I was trying to implement Google AdSense sideboxes as plugin. The idea is not bad. I think lots of zen-cart mods could have plugin wrapper without the need to really change a lot. Also,  plugins automatically provide a way of accessing and storing config values.

Admittely, in the case where the plugin needs to generate template code it gets a bit tricky. Still, I think my new ZMBoxPlugin class does quite well in protecting the plugin author from all the underlying nitbits.

The nice thing is that there are a few more things that I would like to use - Google Analytics, etc. Plugins will provide a good way of separating additional functionallity that perhaps not everyone wants/needs from the main ZenMagick code.

So, for now, there will be box plugins and generic plugins. Both beling to the group of request plugins, which is the most generic group planned.  Request, in this context, means that those plugins will be instantiated and initialised for every request. Possible other groups could be checkout, account, etc.

Not sure yet how this will scale. I might add something to the core compressor to allow plugins to be compressed as well, maybe in a separate file. However, there are a couple more questions to be answered before that should work.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.