Developing mediasyntax

From ThorstensHome
Jump to: navigation, search

This page is about how I develop my mediasyntax plugin.

Most important links for it are


adding debugging output

     global $conf;
         dbglog('---- PLUGIN INCLUDE META DATA START ----');
         dbglog('---- PLUGIN INCLUDE META DATA END ----');

goes to $conf['cachedir'].'/debug.log'

Understanding syntax plugins


$mode can be

  • base
  • listblock
  • plugin_mediasyntax_header
  • and much more


Addentrypattern seems only to be valid for $mode.

getting plugins from github

With github, we can give a download URL that always points to the latest code, like this: You will get a .zip file from there called something like Now we have the challenge that we cannot predict the name of the folder inside the zip file where your plugin is stored (4ea4c86 should change with every version). Not a problem if you set the "base" value under Plugin manager will then unpack the plugin to this directory.


The real problem about the toolbar is that you need to refresh it after you did changes. This works sometimes with:

tweedleburg:/srv/www/htdocs/dokuwiki # rm -rf data/cache/*

If it does not work you have to re-load the plugin using the plugin manager.


The ability to include other pages comes from the include plugin, here is the commit: The problem with including pages is that they will be kept in the cache. Example: Administrator a edits a page foo and includes the page secret. Now in the cache, the page foo contains the page secret. If bad boy b now reads page foo, he also sees secret. Possible solutions: Disable cache as in

$controller->register_hook('PARSER_CACHE_USE', 'BEFORE', $this, '_cache_use'); 

and in _cache_use:

$event->_default = 0;

See also