Hi,
 
thanks for your comment.
The Information you rely on is a fairly old.
 
Currently I have plans implementing it this way (OVERVIEW):
* There's a directory with plugins, e.g. ./plugins/*
* Each plugin resides in a own directory, let's call it "foo_plugin" for now.
This assumes that there is a file called foo_plugin.inc which includes a class foo_plugin
* In the configuration, we have a simple array list of enabled plugins
$rcmail_config['plugins_enabled'] = array('foo_plugin', 'bar_plugin');
* on the first called hook we initiate the rcube_plugins class which is a singleton
this class initalizes every plugin and - in the constructor of these - the plugins itself register to some hooks.
this is done only once every request (because rcube_plugins is a singleton)
* if registered hooks are called...
every plugin is called - one after another - in the order given in the config above.
therefore an array of data is passed to each plugin - and at last - returned to the roundcube code.
 
Have I missed someting?
 
I don't exactly know if this process was posted before completely - but this is what I am thinking about currently.
Thanks for anyone contributed so far.
 
I 've set mysqlf a deadline to wait for requests before implementing a second prototype.
This is the 19th of August. From that date on I want to implement a second prototype using the current definition over the following weekend.
 
Theoretically it should be functional and ready for testing.
 
I try to keep track of the current discussion in summary here:
http://www.lagg.at/temp/todo-rc-plugin
There are also some open questions (mostly regarding implementing frontend plugins) on this site.
 
Thanks,
 
--
Florian Lagg
-
 Florian Lagg - IT-Komplettlösungen
 Juch 7, 6631 Lermoos
 tel +43 (699) 10 20 10 24
 www.lagg.at - info@lagg.at
-
 Xing: http://www.xing.com/go/invite/7372113.3da562
-
 


Von: Patrick Garsow [mailto:pgarsow@gmail.com]
Gesendet: Donnerstag, 7. August 2008 21:48
An: Michael Baierl
Cc: Florian Lagg; RoundCube Dev
Betreff: Re: [RCD] Plugin-Architecture

I agree Mike a single location is what I would say is a solid solution. To simplify for beginners a simple editing script could be made to assist when adding a plugin to config the hooks. Talk about a solid plugin architecture was brought up in recent discussion and I have been seeing more and more about this so I would say maybe it is time implement more solid plugin functionality.
 
Pat
 
 

 
On 7/31/08, Michael Baierl <mail@mbaierl.com> wrote:
Florian Lagg wrote:
> So here are my questions:
> * How should a plugin-architecture be implemented in RoundCube?
> Maybe my approach is completely wrong, just tell me if you think so...
> I'm thinking of a PluginHooks singleton class which is called from
> various points in the existing source code. This class reads a config
> file if there is a plugin registered for the specific event. This config
> contains a line for each event like this:
> $rcmail_config['pluginevent_userlogin'] =
> array('Funambol');                            //registers a single
> plugin called "funambol" for the event "userlogin"
> $rcmail_config['pluginevent_nextEvent'] = array('Funambol',
> 'AnotherPlugin);    //call two plugins in the given order
> PluginHooks then initates a class Funambol (located in
> RC_Home/plugins/Funambol) and calls a method pluginevent_userlogin.
> Because PluginHooks is a singleton, it could provide methods to the
> plugins to get or manipulate data from the rest of RC. so anything is
> handled over this class.
> I hope I discribed it well. Please bring your own ideas if you have
> better once.

Hi Florian,
first of all thanks for the offer to do a lot of work for the community!

Regarding the config as you outline it above - I don't think this is the
way to go as it is not very flexible; ideally a plugin just requires to
be downloaded to a certain directory and to be enabled in a single
place, that's it. In the above code every time a plugin is added the
config has to be changed to adopt the hooks.

Instead I would recommend a well-known location (index.php, config.php)
in the plugins directory which calls those hook-registration points
itself. This gives full control over to the plugin with minimal impact
on configuration.

My 2 cents,

Mike

--
Michael Baierl
<http://mbaierl.com/blog/> < Mike's Blog
- - - - - - - - - - - - - - - - - - - - -
Java is renowned for its industry-standard visual interface which
supports up to 16 colors thanks to its cutting-edge SmartColor™
technology./n
_______________________________________________
List info: http://lists.roundcube.net/dev/