[dokuwiki] loading helper plugin from /helper directory

  • From: Mª®k <mc.prins@xxxxxxxxx>
  • To: dokuwiki <dokuwiki@xxxxxxxxxxxxx>
  • Date: Wed, 9 Mar 2011 12:06:38 +0100

I'm working on some helper plugins that I hav split up into various
parts, ic. search.php and index.php that both live in /helper/ I have
a action.php that hooks into some events and tries to load the
appropriate helper plugin, which is where I got stuck an hour ago...

the action code snippet:

$id=$event->data[0];                    
dbglog('page id = '.$id,'---spatialhelper---');
dbglog('loading indexer');
//$indexer = $this->loadHelper('spatialhelper index', 'plugin not found');
//$indexer = $this->loadHelper('spatialhelper/index', 'plugin not found');
//$indexer = $this->loadHelper('plugin_spatialhelper_index', 'plugin
not found');
//$indexer = $this->loadHelper('helper_index', 'plugin not found');
//$indexer = $this->loadHelper('spatialhelper', 'plugin not found');
//$indexer = $this->loadHelper('spatialhelper_index', 'plugin not found');
$indexer = $this->loadHelper('index', 'plugin not found');
        
if (!$indexer) dbglog('plugin not found. $indexer='.$indexer);
if($indexer) {
        dbglog('running indexer');
        $entries = $indexer->updateSpatialIndex($id);
        dbglog('entries:'.$entries,'---spatialhelper---');
}

As you can see I've tried l sorts of combinations of names... but the
log keeps saying:

11:48:41 127.0.0.1: ---spatialhelper---
page id = user:mcprins:test
11:48:41 127.0.0.1: loading indexer
11:48:41 127.0.0.1: plugin not found. $indexer=

The plugin class is defined as:

        class helper_plugin_spatialhelper_index extends DokuWiki_Plugin {...}

and it shows up fine (and runs the constructor code) in the plugin manager.

So any hints on what the name should be for loading this plugin? Also
the $msg of the loadHelper doesn't show up anywhere?

thanx, Mark
-- 
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: