Basically you just check to see if anything is scheduled to happen on each page request. This is assuming the page request happen frequently.
The other way to do it would be to create a "cronjobs_controller.php" that would have table called cronjobs full of tasks that needed to be executed and their corresponding schedules. You could then setup a page to access in your controller that would check for tasks to execute. You can then setup an actual cron job to access that part of the controller via a standard url using wget or possibly curl. That way you know that you are checking for tasks to run on a regular schedule and not just on page requests.
I have not implemented this yet, but this is how I plan on implementing an automated billing system in the near future.
On 9/12/06,
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I don't think it's beyond Cake at all, I have an application that sends
day-before-reminders to users via SMS. The only different thing is cron
jobs, which are simple to set up on your host. Just have a script that
sends the email to your users and set the cron to run the script
everyday. Easy peasy!
Chris Hartjes wrote:
> On 9/12/06, Marcelo de Moraes Serpa <[EMAIL PROTECTED] > wrote:
> > I'm thinking about implementing a service where the user gets warned by
> > email 1 day before the event will happen. However, I'm not sure how I will
> > trigger it, what I imagine is that a service should be running 24/7. How
> > could I do that?
> >
> > Thanks in advance,
> >
>
> Er, I think that is something beyond the scope of CakePHP and more
> along the lines of writing daemon code in PHP. There are some good
> examples, but George Schlossnagle's book on Advanced PHP Programming
> has a big chapter on writing daemons in PHP.
>
> I do a lot of work with CLI scripts written in PHP, so it can be done.
>
> --
> Chris Hartjes
>
> "The greatest inefficiencies come from solving problems you will never have."
> -- Rasmus Lerdorf
>
> @TheBallpark - http://www.littlehart.net/attheballpark
> @TheKeyboard - http://www.littlehart.net/atthekeyboard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---
- Re: Messaging service John Zimmerman
- Re: Messaging service Martin Schapendonk
- Re: Messaging service Brian Wisti
- Re: Messaging service John Zimmerman
