Re: Question about apache-php concurrent process control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi André,

It sounds interesting. But since I am pretty new to PHP, I have some questions, naive maybe, about what you wrote.

"#!/bin/sh\n/path/to/script/Send.php 12 &\n"

What does the Send.php look like? I do not have idea how a shell interprets an php script and what the parameter 12 means here. If you do not mind, could you please also let me look at your Send.php?

Thank you very much.

I did something like that for a newsletter sending script. Basiclly, I
had two scripts:

a) AddEdit.php that would list the newsletter's items and allow it to send
b) Send.php that was a script I ran on the background

When pressed "Send" on AddEdit, it would do something like

$tempName = tempnam( '/tmp', 'newsletter' );
$fp = fopen( $tempName, 'w+' );
fputs( $fp, "#!/bin/sh\n/path/to/script/Send.php 12 &\n" );
fclose( $fp );
chmod( $tempName, 0755 );
system( $tempName . ' &' );

That way, it would launch the second script into the background,
checking if the script altered the newsletter's state for "Sent"
everytime a user saw the newsletter's details.

Hope it helped.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux