简体   繁体   中英

Typo3 scheduler: Can i somehow execute Action of controllers of my extension with it? Or how to run my own code with it?

A while ago i was tasked to program a Typo3 extension to write so called .conf files for the icinga2 montoring tool (has nothing to do with Typo3). Still let me explain some parts of it: Basically the backend user needs to create records of records of specific classes and set values for each records properties. Then i need to process the records to create these .conf files with the specific values with a php script.

I was tasked to use the scheduler in Typo3 for this. And here come the problems: How do i use this? I checked the documentation ( https://docs.typo3.org/typo3cms/extensions/scheduler/Introduction/Index.html ), but i still can't wrap my head around how to use it for my task. I can easily write an Action in a controller of a class to be executed in the frontend and in turn generate the con files... basically manually without the scheduler. But where do i put my php code to be run by the scheduler? I somehow seem not to understand the basical principle of the scheduler. Can i just run an Action of a specific controller of a class of my extension like i would in the Frontend via the scheduler?

I would suggest you use a command controller for this task.

The documentation shows how to create a command controller, which also may accept arguments.

Command controller tasks can directly be executed by TYPO3 scheduler (see screenshot below)

在此处输入图片说明

You may even configure task arguments for command controller tasks in TYPO3 scheduler.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM