Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scheduling execution of a function

Tags:

php

cakephp

How can I get a function executed in a php (cakephp) application at a specific point of time, without the intervention of a person clicking the link or triggering the function by himself/herself?

like image 210
pushpa Avatar asked Jul 09 '26 21:07

pushpa


2 Answers

All other answers so far are right, you'll need to schedule a cron job (or scheduled task on Windows). With that said, CakePHP is designed to answer HTTP requests and not work through the command line.

For a tutorial specific to CakePHP, visit http://bakery.cakephp.org/articles/mathew_attlee/2006/12/05/calling-controller-actions-from-cron-and-the-command-line.

like image 167
Francois Deschenes Avatar answered Jul 12 '26 04:07

Francois Deschenes


If you are on Linux or Mac, try Cron:

  • http://en.wikipedia.org/wiki/Cron
  • https://stackoverflow.com/questions/tagged/cron
like image 44
TuteC Avatar answered Jul 12 '26 05:07

TuteC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!