Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

How deep the changes in the API should be?

14.8% 18
13.9% 17
13.9% 17
57.4% 70

122 Дата 20.04.2009 03:09

Форумы / Cotonti / Core Labs / Archive / Опрос: Plugin API changes

How far can we go?

#13129 11.06.2009 08:34
I hope we have chosen Major upgrade (or Brand new but very carefully) ? I hope so!

# Trustmaster : OK, here is a list of suggestions I have collected so far:
  • Remove SED_EXTPLUGIN block from every single plugin file...
  • Specify hook bindings as an array in setup file like:
    $hooks = array(
    	array('filename1', 'hook1', 10),
    	array('filename1', 'hook2'),
    	array('filename2', 'hook3', 99)
    where the third optional parameter is priority (order). As you can see, it also allows for multiple hook bindings.
  • Automatically preload plugin permissions into $usr['auth_read'], $usr['auth_write'] and $usr['isadmin'].
  • Automatically preload plugin langfile.
  • Already added in tickets: simplify CODE check. It can be
    defined('COT_CODE') or die('Wrong URL');
  • Time to change sed_ to cot_

  • More brainstorming while writing a plugin:

    7. Auth hooks. Add ability to affect auth in exact places (already known as EYOOP issue).

    8. SQL query hooks. There are some important queries that a plugin developer would like to modify before they get executed...

    I known that all the items we must to do because all these improvements will reduce the time to create new plugins! And we must do so now because the little time.

    # Trustmaster :

    Finally I've completed my "callbacks vs. includes" experiment and here is the summary:
    • XCache is good for your health. With XCache there is absolutely no difference between callbacks and includes, not to mention things go significantly faster.
    • Without XCache includes are 5% slower than callbacks in loops and both are almost the same in normal hooks.
    • It takes 2 minuts to convert 1 plugin part to a callback.
    To conclude it, callbacks are not so great on performance as we supposed. If 5% is really important for you, then your site is popular enough to run a dedi/VPS or at least ask your hoster for XCache.

    So we will focus on improving includes() and architecture changes won't be so dramatic.

    This is good news. Thank you for your work!
    Pavel Tkachenko aka Dayver. Гик и веб мастер который делает сайты, увлекается электроникой и очень любит смотреть кино.
    О себе: Я злой и страшный серый волк, я в поросятах знааааюююю толк