yes you can do this ; create an additional action : "backgroundscript" that call your exec ("/usr/bin/php yourscript.php" >/dev/null &");
in your main real action use curl to call your "backgroundscript" action with the appropriates options : curl_setopt($ch,CURLOPT_TIMEOUT, 1) curl_setopt($ch,CURLOPT_NOBODY,true) curl_setopt($ch,CURLOPT_RETURNTRANSFER,true) ... this will wait just 1 second. All this isn't pretty at all but it works fine > On Oct 18, 1:41 am, McFadly <[EMAIL PROTECTED]> wrote: > Also if you're using cakephp 1.2 look into the console. cakebaker has > a good starting > point:http://cakebaker.42dh.com/2007/05/07/writing-a-custom-cakephp-console... > > On Oct 17, 1:50 pm, fr3nch13 <[EMAIL PROTECTED]> wrote: > > > hint - search this group for 'cron jobs' > > > On Oct 17, 1:58 pm, Felix Geisendörfer <[EMAIL PROTECTED]> wrote: > > > > You might want to check out this extension if you you need things like > > > this: > > > >http://www.vl-srm.net/doc/ > > > > However, you find it easier to have a queue table that is processed by a > > > cron executed script for your background processing needs. > > > > -- Felix > > > -------------------------- > > > My Blog:http://www.thinkingphp.org > > > My Business:http://www.fg-webdesign.de > > > > Baz wrote: > > > > This isn't a very CakePHP question. > > > > > It's straight PHP. The short answer is no. Anything you execute in PHP > > > > is going to be done in a blocking call. > > > > -- > > > > Baz L > > > > Web Development 2.0 > > > >http://WebDevelopment2.com/ > > > > > On 10/17/07, *regent* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> > > > > wrote: > > > > > I need to run a php script in the background. I have figured out I > > > > can run it like this: > > > > > exec ("/usr/bin/php yourscript.php" >/dev/null &"); > > > > > I have 2 questions concerning this: > > > > > 1) Can I run a php script within the CakePhp framework? I've been > > > > able to run it outside the framework, I just put the script under > > > > webroot. But can i run it within the framework so I can take > > > > advantage of CakePhp's extra functionality? To be more clear, I > > > > want > > > > the script to reside in one of my views folders, so I can still take > > > > advantage of Cake's functions. > > > > > 2) How do I pass arguments to the script? I need the exact syntax. > > > > I've searched google and could not find a clear example of how to do > > > > this. > > > > > Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---