All pastes #2050933 Raw Edit

Untitled

public text v1 · immutable
#2050933 ·published 2011-04-26 17:27 UTC
rendered paste body
                if(is_array($_SESSION['s']['plugin_cache'][$event_name])) {
                        foreach($_SESSION['s']['plugin_cache'][$event_name] as $rec) {
                                $plugin_name = $rec['plugin'];
                                $function_name = $rec['function'];
                                $plugin_file = ISPC_LIB_PATH.FS_DIV.'plugins'.FS_DIV.$plugin_name.'.inc.php';
                                if(is_file($plugin_file)) {
                                        if(!isset($app->loaded_plugins[$plugin_name])) {
                                                include_once($plugin_file);
                                                $app->loaded_plugins[$plugin_name] = new $plugin_name;
                                        }
                                        if($this->debug) $app->log("Called method: '$function_name' in plugin '$plugin_name' for event '$event_name'",LOGLEVEL_DEBUG);
                                        // call_user_method($function_name,$app->loaded_plugins[$plugin_name],$event_name,$data);
                                        call_user_func(array($app->loaded_plugins[$plugin_name],$function_name),$event_name,$data);
                                }
                        }
                        
                }