till wrote:
Maybe we can work on a required set of "methods" and calls for all plugins to get rid off those [file, function]_exists() things. We
Still you need them as RCD should not fail in case something is missing. And it does not make sense to force the plugin developer to have to create a long template with all callbacks. You will always end up with such _exists() methods if you upgrade your Plugin API - you don't want the plugins to fail...
could also register available methods/calls via an ini file (of course parsing of those should be cached) which exposes them.
Why INI? Use a PHP file instead. And still it will be slower then using function names and function_exists calls.
I am all for dropping in plugins and running them - on the same side this very dynamic context also eats away on resources, so maybe we should have a plugin.ini after all which initializes them or lets roundcube know what is available.
I've already coded some plugin system and did not see any performance hit. I know Typo3 and know that it can eat up a lot of memory in case of a lot of extensions are loaded, but still the plugin overhead itself is relatively small. If you care about file_stat calls (_exists) - just use one init.php per plugin which then loads all other required files.
I'd also like to seperate "core" feature set and plugins. Not everything (by definition)is a plugin, even if they are handled the same.
Like Typo3 does - sys_* plugins are coded the same way, but required by the system. Smart way of doing things!
RE: hooks - interesting idea, I think that would make sense. We can utilize jquery to perform the frontend things for that. We'd probably need an "ajax" endpoint so jquery can give the endpoint a context (e.g. reading mail, writing mail, browsing addressbook, browsing folder, ...) and in return get available plugins for the hooks that are available in this context.
Also check out the wiki for some notes that Brennan and I took on a plugin api.
Michael Baierl http://mbaierl.com/
If the network is down, then you're obviously incompetent so why are we paying you? Of course, if the network is up, then we obviously don't need you, so why are we paying you? _______________________________________________ List info: http://lists.roundcube.net/dev/