dwoo icon indicating copy to clipboard operation
dwoo copied to clipboard

Problem with including own function plugins

Open saitho opened this issue 9 years ago • 1 comments

Hi,

I added my own plugin directory to dwoo: $this->dwooCore->getLoader()->addDirectory($dir);

In this folder I have an own block-plugin which works fine... I did that by copying a Block plugin from the dwoo folder and adjusting the parameters. Now I've copied dwoo's FunctionGravatar in the same manner into my plugin directory and renamed the file and the function to FunctionGravator(.php) just to see if it still works like that.

Calling dwoo's {gravatar email="..."} in the template works fine - my {gravator email="..."}doesn't output anything. The code is the same (I only changed the class name). My FunctionGravator gets listed in the classpaths.

When I copy my FunctionGravator into dwoo's Plugins/Functions folder it works.

I hope you can help me. :)

Thanks. Mario

saitho avatar Mar 26 '16 19:03 saitho

I compared how both classes are processed (Compiler.php ~line 1860):

["func"]=> string(8) "gravatar" ["pluginType"]=> int(17) ["Native"]=> int(0) // $pluginType & Core::NATIVE_PLUGIN ["Class"]=> int(1) // $pluginType & Core::CLASS_PLUGIN ["Custom"]=> int(0) // $pluginType & Core::CUSTOM_PLUGIN ["Proxy"]=> int(0) // $pluginType & Core::PROXY_PLUGIN ["Smarty"]=> int(0) // $pluginType & Core::SMARTY_FUNCTION ["Template"]=> int(0) // $pluginType & Core::TEMPLATE_PLUGIN


["func"]=> string(8) "gravator" ["pluginType"]=> int(18) ["Native"]=> int(0) ["Class"]=> int(0) ["Custom"]=> int(0) ["Proxy"]=> int(0) ["Smarty"]=> int(0) ["Template"]=> int(0)

As you can see here, the bit operation $pluginType & Core::CLASS_PLUGIN for FunctionGravatar is 1, for my custom function class 'FunctionGravator' is 0.

saitho avatar Mar 28 '16 14:03 saitho