[dokuwiki] Re: Plugin system update notice
- From: Myron Turner <turnermm02@xxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Wed, 13 Aug 2008 09:25:12 -0500
Christopher Smith wrote:
(1) Change the syntax plugin handle() function to allow it to return
false when there is no need to create a plugin render instruction for
that particular match. Potentially this could impact plugins which
return false as real data. If false is a problem value, null is a
possible alternative.
This is primarily an efficiency change. It removes unnecessary
rendering instructions from the instruction list.
I will be using it to shift handling of DOKU_LEXER_UNMATCHED matches
from my plugins to the standard cdata handler.
e.g.
function handle($match, $state, $pos, &$handler){
switch ($state) {
...
case DOKU_LEXER_UNMATCHED :
$handler->_addCall('cdata',array($match), $pos);
return false;
...
(2) Add an optional third parameter, $new, to the plugin_load() function.
@param $new bool true to return a new instance of the plugin,
false to use an already loaded instance
function &plugin_load($type,$name,$new=false)
- Chris
Just to get this straight: these changes have no effect unless we are
(1) checking for a false return value from handle()
Or
(2) loading a new instance of a plugin from our own plugin code
The latter might affect the plugin tool of DokuWikiFCK. I'd have to check.
Myron
--
_____________________
Myron Turner
http://www.mturner.org
http://net18reaching.org/cityscapes
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist
- Follow-Ups:
- [dokuwiki] Re: Plugin system update notice
- From: Christopher Smith
- References:
- [dokuwiki] Plugin system update notice
- From: Christopher Smith
Other related posts:
- » [dokuwiki] Plugin system update notice
- » [dokuwiki] Re: Plugin system update notice
- » [dokuwiki] Re: Plugin system update notice
(1) Change the syntax plugin handle() function to allow it to return false when there is no need to create a plugin render instruction for that particular match. Potentially this could impact plugins which return false as real data. If false is a problem value, null is a possible alternative.
This is primarily an efficiency change. It removes unnecessary rendering instructions from the instruction list.
I will be using it to shift handling of DOKU_LEXER_UNMATCHED matches from my plugins to the standard cdata handler.
e.g.
function handle($match, $state, $pos, &$handler){
switch ($state) {
...
case DOKU_LEXER_UNMATCHED :
$handler->_addCall('cdata',array($match), $pos);
return false;
...
(2) Add an optional third parameter, $new, to the plugin_load() function.
@param $new bool true to return a new instance of the plugin,
false to use an already loaded instance
function &plugin_load($type,$name,$new=false) - Chris
- [dokuwiki] Re: Plugin system update notice
- From: Christopher Smith
- [dokuwiki] Plugin system update notice
- From: Christopher Smith