emilhem Posted January 17, 2016 Share Posted January 17, 2016 We need to create a task like we had in 3.4.x. How do you do it in 4.x? I made a file in /applications/core/tasks/ but how do I make it run regularly? Or did I place the file in the wrong place? Link to comment Share on other sites More sharing options...
Ahmad E. Posted January 17, 2016 Share Posted January 17, 2016 That's not an option anymore AFAIK. You can do that through a plugin though. Link to comment Share on other sites More sharing options...
emilhem Posted January 24, 2016 Author Share Posted January 24, 2016 Is there a place to get more documentation with regards to "home made" tasks in a separate plugin? I can't seem to find anything that is detailed enough. I've found the following resource already. Link to comment Share on other sites More sharing options...
steve00 Posted January 25, 2016 Share Posted January 25, 2016 On 17/01/2016 at 1:18 PM, emilhem said: We need to create a task like we had in 3.4.x. How do you do it in 4.x? I made a file in /applications/core/tasks/ but how do I make it run regularly? Or did I place the file in the wrong place? Are you referring to CRON job ? If so then you can run a cron with 4.1 tasks which you can set up from System>Settings>Advanced Configuration Link to comment Share on other sites More sharing options...
EmpireKicking Posted January 25, 2016 Share Posted January 25, 2016 you can run tasks using the rules lite plugin Link to comment Share on other sites More sharing options...
emilhem Posted January 26, 2016 Author Share Posted January 26, 2016 23 hours ago, steve00 said: Are you referring to CRON job ? If so then you can run a cron with 4.1 tasks which you can set up from System>Settings>Advanced Configuration No more like actual documentation with regards to creating the PHP task file and what is supposed to be in it. I've created a task in a separate plugin but the file that it creates doesn't contain much documentation. So what I need is like the very detailed API documentation that existed for 3.x. Link to comment Share on other sites More sharing options...
Daniel F Posted January 26, 2016 Share Posted January 26, 2016 What information do you need? It's much easier then in IPB3. All you need to do is to add your code inside the execute method. Link to comment Share on other sites More sharing options...
emilhem Posted January 27, 2016 Author Share Posted January 27, 2016 How do you log things? Do you just echo and IPS takes that data as a log or what? Link to comment Share on other sites More sharing options...
Daniel F Posted January 27, 2016 Share Posted January 27, 2016 It's noted in the task file Quote If an error occurs which means the task could not finish running, throw an \IPS\Task\Exception - do not log an error as a normal log. Quote /** * Execute * * If ran successfully, should return anything worth logging. Only log something * worth mentioning (don't log "task ran successfully"). Return NULL (actual NULL, not '' or 0) to not log (which will be most cases). * If an error occurs which means the task could not finish running, throw an \IPS\Task\Exception - do not log an error as a normal log. * Tasks should execute within the time of a normal HTTP request. * * @return mixed Message to log or NULL * @throws \IPS\Task\Exception */ Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.