开发者

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


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


Can't you just curl or wget the URL?


You can do it as:

lynx > /dev/null -dump "URL"
wget -q -O /dev/null "URL"
fetch -o /dev/null "URL"
curl -s -o /dev/null "URL"

just replace URL

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜