call_user_func and variables by reference

glagoglemnast

New Member
Hy there. I'm developing plug-in system and I have problems with call_user_func and referenced variables.I'm calling plug-in handler like this:\[code\] if(PluginFactory::NumberOfPlugins() != 0) foreach(PluginFactory::GetPlugins() as $pPlugin) call_user_func(get_class($pPlugin) . "::OnHandlePluggablePart", "Core:AfterSceneAssembly", $Document);\[/code\]Where \[code\]$Document\[/code\] is my document object where I hold my controls. The idea is that plug-ins can modify control set (add, delete, modify). My plugin class is this:\[code\]class SomePlugin extends Plugin{ ... public static function OnHandlePluggablePart($sPart, &$Document) { if($sPart == "Core:AfterSceneAssembly") { $Document->AddControl(new Paragraph("", "Plugin test")); } }}\[/code\]Document object is passed by value (copied) not reference...What to do, what to do :) ?
 
Back
Top