We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Call a action every Monday

Hi,

How can I do to call an action from my Controller every Monday with Phalcon ?

There is a solution to do that ?

John.

Hey, if i understnad you correctly you can create a cronjob script which executes a curl to your action.

Info on curl: https://php.net/manual/en/function.curl-exec.php

edited Nov '15

Perfect ! Thanks I'll try that :)

Edit : I can't accept your answer :O I don't know why.

edited Dec '15

You cannot do it without something calling your action via url. And that's what is cron job made for. You put a cron job (crontab), and make it execute your action via curl every monday.

Note: you need Linux for this, either on your server or elsewhere as long as external system can access your URL. P.S. and there is another solution, basically to have your PHP CLI program daemonized, so it will run in an endless loop and do the cron tasks for you.