How deep the changes in the API should be?

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

122 Datum 2009-04-20 03:09

Forums / Cotonti / Core Labs / Archive / Poll: Plugin API changes

How far can we go?

Trustmaster
#11651 2009-04-21 19:17
OK, here is a list of suggestions I have collected so far:
  1. Remove SED_EXTPLUGIN block from every single plugin file. In fact, it is more annoying and redundant rather than useful. "Code" is the same as plugin name. "Part" can be identified by file name. "Hooks" can be binded in setup file (see below). "Tags" are better to be collected they way "tpltags" plugin does it (by scanning the code instead of forcing plugin developer to describe every tag). "Order" can be specified in hook binding.
  2. 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.
  3. Automatically preload plugin permissions into $usr['auth_read'], $usr['auth_write'] and $usr['isadmin'].
  4. Automatically preload plugin langfile.
  5. Already added in tickets: simplify CODE check. It can be
    defined('COT_CODE') or die('Wrong URL');
  6. 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. For example, if you want to affect forum posts order and join it with another table. Currently queries are executed like $sql = sed_sql_query("SELECT ..."), so the only way to change it is either a corehack or another similar query. If we did it like:
$query = "SELECT ...";
forums_posts_query(); // HOOK here
$sql = cot_query($query);
it could leave a possibility to edit the query with a plugin before it gets executed. It's not the most elegant way to modify a query, but if you know a better way, don't hesitate to share.
May the Source be with you!

Dit bericht is bewerkt door Trustmaster (2009-07-15 04:28, 14 jaren ago)