- Wed Oct 18, 2023 5:56 am
#830987
When it executes a case generated by timer events it doesn't load the class of the plugin, only the PMfunctions of plugins.
I have a case that it can be excuted for two ways, manually or automatically by timer, this case executes a trigger that calls a function from a plugin, when it's excuted manually it works everthink okey, but when it exceute by cron it doesn't work. Looking at the logs I found the problem, the cron execution case doesn't load the classes of the plugins, only the PMfunctions, and the manual generation case loads all the classes of the plugins.
Inside my plugin class in the setup() function I load extra classes that I will use in the PMfunctions. The easiest way to solve this is to put the external classes I load inside the setup() directly into PMfunctions. But that's not the right way.
Debugging a little the flow of execution of crons cases I think that I found the moment that it loads the plugins, in file cron_single.php it calls a function that loads the plugins but for some reason only load the pmFunctions, not the classes of the plugins.
I have a case that it can be excuted for two ways, manually or automatically by timer, this case executes a trigger that calls a function from a plugin, when it's excuted manually it works everthink okey, but when it exceute by cron it doesn't work. Looking at the logs I found the problem, the cron execution case doesn't load the classes of the plugins, only the PMfunctions, and the manual generation case loads all the classes of the plugins.
Inside my plugin class in the setup() function I load extra classes that I will use in the PMfunctions. The easiest way to solve this is to put the external classes I load inside the setup() directly into PMfunctions. But that's not the right way.
Debugging a little the flow of execution of crons cases I think that I found the moment that it loads the plugins, in file cron_single.php it calls a function that loads the plugins but for some reason only load the pmFunctions, not the classes of the plugins.
Code: Select all
Has anyone had the same problem or knows the way to load the classes of plugins in the timer by default or know who to call the function to load the classes of plugins? // We load plugins' pmFunctions
$oPluginRegistry = PluginRegistry::loadSingleton();
$oPluginRegistry->init();