> Well I don't think that because databases are getting better then we
> should stop writing good code because the database can handle the
> extra load of a bad written application, at least in my case. The log
> file I'm processing with the cake shell is being written constantly,
> and the data that I need from the database could be thousands of
> registers, so doing several queries to the database per second to
> bring  the same thousand of records each time in most cases just to
> see if there's a new one seems like a bad idea to me.
>
> OTOH being able to notify the cake shell when there's new data that it
> can query or send it the new data is a much better solution, like with
> a web service, but I don't know if I can use them with a cake shell.
>

What you are talking about is an event loader. Depending what the log
is logging you can do two things:
- Do a cron job on a specific time
- Find out when the log is updated and fire the event there and then.

Updating on files changes is a bit difficult. I have a perl-script
(yes, need to change it to php, one day) that fills a temp-file. The
data there is only valid for 2 days. (email validation)
Every time the script runs it just looks in that temp-file and cleans
it up. Otherwise it just sits there with obsolete data. The script
does different things so it gets called for different reasons.

Either put some handler in the your index or any other file that gets
frequently called to fire your function. It's not a decent method, and
if it's a big job don't do it. But it's a way of doing it. Kinda
random cron-job.

If you're running windows use the windows task scheduler with php.exe

Daniel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to