You are here: Re: window.setTimeout equivalent in PHP? « PHP Programming Language « IT news, forums, messages
Re: window.setTimeout equivalent in PHP?

Posted by Aaron Saray on 09/03/07 14:52

On Sep 3, 9:19 am, Michael Fesser <neti...@gmx.de> wrote:
> .oO(Jerry Stuckle)
>
> >Michael Fesser wrote:
> >> .oO(Jerry Stuckle)
>
> >>> OK, you're using the wrong tool for this. PHP is server side, not
> >>> client side, and has no idea what happens at the client.
>
> >> Csaba wrote:
>
> >> | My question was about CLI PHP (Command Line Interface or CLIent side
> >> | php), and not server side processing.
>
> >Yes, I can read, Micha. My comment stands.
>
> The CLI doesn't involve any server. I even use it for shell scripts. Of
> course you can write applications in PHP that don't communicate via HTTP
> with some other. As far as I understand the OP is using PHP for writing
> some kind of Windows application and wants to capture messages sent by
> another app.
>
> Micha

I would suggest starting a while loop with a sleep timeout that checks
something

$myEventHappened = false;
$timeout = 1;

while (true) {
sleep($timeout); // or whatever

/** code to update $myEventHappened **/


if ($myEventHappened) {
/** possibly do something **/

/** maybe change our loop? **/
$timeout = 2;

/** or maybe lets say we exit **/
$myEventHappened = true
}

/** check to see if we should continue **/
if ($myEventHappened) {
break;
}

}


This "might" make sense for you if you're making a client side
("compiled"?) php application for your users.
Of course, I'd take the advice of some people above if you're
programming more client side stuff :)

-aaron

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация