Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Problem with including own function plugins #43

Open
saitho opened this issue Mar 26, 2016 · 1 comment
Open

Problem with including own function plugins #43

saitho opened this issue Mar 26, 2016 · 1 comment
Assignees
Labels

Comments

@saitho
Copy link

saitho commented Mar 26, 2016

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
Copy link
Author

saitho commented Mar 28, 2016

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.

@emulienfou emulienfou added the bug label Sep 10, 2016
@emulienfou emulienfou added this to the 2.0 milestone Sep 10, 2016
@emulienfou emulienfou self-assigned this Sep 10, 2016
@emulienfou emulienfou modified the milestones: 2.0, 1.3.0 Sep 19, 2016
@emulienfou emulienfou modified the milestone: 1.3.1 Dec 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants