Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call a Kohana helper from cron (or any URL)

I need to call a Kohana helper (or any php MVC framework) from a Cron job.
How can I do this?
The server is Linux, so, I can only think of two possible solutions:
1- Open an URL from the cron job, which hits a controller and does what it has to do.
2- Call a Kohana controller without passing through the web server, but with the PHP CLI. (is that even possible? I don't think so, it might need the web server environment to work)

Know a solution? Thanks

like image 1000
Petruza Avatar asked Nov 12 '09 13:11

Petruza


2 Answers

with the kohana framework you can pass the "uri" as a command line parameter:

/path/to/index.php controller/method/param

you might want to try that, you will definitely need a controller but you dont need to use wget or curl

like image 115
Nodren Avatar answered Nov 09 '22 03:11

Nodren


Can't you just curl or wget the URL?

like image 24
Paul Tomblin Avatar answered Nov 09 '22 04:11

Paul Tomblin