Answer the question
In order to leave comments, you need to log in
How to create an agent in your module?
Hello. I am developing a module and I need to create an agent during module installation. To create an agent, I use CAgent::AddAgent() to this method, you need to pass a class and a function that the agent will run. Where should they be placed in the module structure?
Answer the question
In order to leave comments, you need to log in
And what is the actual question? Do as according to the documentation
1) When installing the module, add the agent:
where
"\\Your\\Module\\SuperClass::superAgent();" - php code to be executed (semicolon at the end strictly!!!)
"your.module" - name of your module
"N" - frequency
10 * 24 * 3600 = start frequency
'' - first check date (leave empty)
" Y" - agent activity
2) When deleting - we clear the agents
3) If the files are located according to the d7 canons ( /your.module/lib/superclass.php ), then nothing else needs to be done, if the old one, then you need to register it in include.php autoloader for your class with an agent
It doesn't really matter. Check only that the agent function is available when the module is connected.
Where should they be placed in the module structure?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question