sun's longitude:43 15 10 
¡¤ ÀÚÀ¯°Ô½ÃÆÇ ¡¤ ¹¯°í´äÇϱ⠡¤ ¾ËÆĹ®¼­ ¡¤ RPMS list
¡¤ »ç¿ëÀÚ¹®¼­ ¡¤ ÆÁ/FAQ¸ðÀ½ ¡¤ ¸®´ª½ºLinks ¡¤ ÀÚ·á½Ç
¡¤ ¼­¹öÁ¤º¸ ¡¤ ¿î¿µÀÚ ¡¤ Books/FAQ ¡¤ FreeBSD
 
/board/delete.php:¼Ò½ºº¸±â   
 
¾ËÆĹ®¼­
ÀÚÁÖ Àؾî¸Ô°Å³ª, ¸Þ¸ðÇØ µÑ Çʿ伺ÀÌ ÀÖ´Â ÆÁÀ̳ª ¹®¼­, ±âŸ µîµî
[*** ¾²±â ±ÝÁö´Ü¾î ÆÐÅÏ ***]
±Û º»¹® Áß°£¿¡ ¾÷·ÎµåÇÒ À̹ÌÁö¸¦ Ãß°¡ÇÏ´Â ¹æ¹ý : @@À̹ÌÁöÀ̸§@@
ex) @@foo.gif@@
 ¡Ú ±Û Áö¿ì±â Ç׸ñÀÔ´Ï´Ù. Çѹø ´õ »ý°¢ÇÏ½Ã°í °áÁ¤ÇϽʽÿÀ.!!!
Á¦¸ñ 196 : [PHP] imitative Async I/O non-block exec
 À̸§  »êÀÌ [Ȩ]http://linuxchannel.net/
## Async I/O Èä³»³»±â
-------------------------------
<?php
##
## -- san2@2009.02.03
## -- imitative Async I/O non-block execution


## imitative Async I/O run execution
$proc[] = popen('sh ss.sh 8 2>&1','r');
$proc[] = popen('sh ss.sh 10 2>&1','r');
$proc[] = popen('sh ss.sh 20 2>&1','r');

## none-block
foreach($proc AS $fp)
{
stream_set_blocking($fp,0);
$stream[] = $fp;
}
print_r($stream);

while($read = $stream)
{
if(stream_select($read,$w=NULL,$e=NULL,0,500000) === FALSE) continue;
foreach($read AS $fp)
{
//while($buf = fgets($fp,512)) echo $buf;
fpassthru($fp);
if(feof($fp))
{
$key = array_search($fp,$stream);
unset($stream[$key]);
fclose($fp);
}
}
}
exit;
?>
-------------------------------
<?php
## -- san2@2009.02.03
## -- imitative Async I/O non-block execution

## 0=>stdin, 1=>stdout, 2=>stderr
$desp = array(0=>array('pipe','r'), 1=>array('pipe','w'), 2=>array('pipe','w'));

## imitative Async I/O run execution
$proc[] = proc_open('sh ss.sh 8',$desp,$p[]);
$proc[] = proc_open('sh ss.sh 10',$desp,$p[]);
$proc[] = proc_open('sh ss.sh 20',$desp,$p[]);

## set non-block
foreach($p AS $fp)
{
fclose($fp[0]);
stream_set_blocking($fp[1],0);
$stream[] = $fp[1];
}
print_r($stream);

while($read = $stream)
{
if(stream_select($read,$w=NULL,$e=NULL,0,500000) === FALSE) continue;
foreach($read AS $fp)
{
//while($buf = fgets($fp,512)) echo $buf;
fpassthru($fp);
if(feof($fp))
{
$key = array_search($fp,$stream);
unset($stream[$key]);
fclose($fp);
fclose($p[$key][2]);
proc_close($proc[$key]);
}
}
}
exit;
?>
-------------------------------
<?php
## -- san2@2009.02.03
## -- imitative Async I/O non-block execution, simple but not good

## 0=>stdin, 1=>stdout, 2=>stderr
$desp = array(0=>array('pipe','r'), 1=>array('pipe','w'), 2=>array('pipe','w'));

## imitative Async I/O run execution
$proc = proc_open('/bin/sh -i',$desp,$fp); // zombie

## set non-block
stream_set_blocking($fp[0],0);
stream_set_blocking($fp[1],0);

fwrite($fp[0],'/bin/sh ss.sh 12 2>&1 &');
fwrite($fp[0],'/bin/sh ss.sh 8 2>&1 &');
fwrite($fp[0],'/bin/sh ss.sh 20 2>&1 &');
fclose($fp[0]);

$stream = array($fp[1]);
while(1)
{
if(stream_select($stream,$w=NULL,$e=NULL,0,500000) === FALSE) continue;
while($buf = fgets($fp[1],512)) echo $buf;
//fpassthru($fp[1]);
if(feof($fp[1]))
{
fclose($fp[1]);
fclose($fp[2]);
proc_close($proc);
break;
}
}
exit;
?>
-----------------------------------------
2009³â 02¿ù 03ÀÏ 13:58:37 È­(¿ÀÈÄ)  from 114.111.62.248
0
¾ÏÈ£: °ø¿ë º¸¾È SSL ¼­¹ö°¡ ÁغñµÇ±â Àü±îÁö´Â off ÇÕ´Ï´Ù

apache lighttpd linuxchannel.net 
Copyright 1997-2024. linuxchannel.net. All rights reserved.

Page loading: 0.04(server) + (network) + (browser) seconds