|
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
[Back to original message]
|