docs: add uv_stdio_new function

This commit is contained in:
Shuhei Tanuma 2012-07-23 00:08:05 +09:00
parent 4dd2ed56fa
commit be24fe6155
3 changed files with 3 additions and 2 deletions

View File

@ -1680,6 +1680,7 @@ var_dump(uv_cpu_info());
### array uv_interface_addresses(void) ### array uv_interface_addresses(void)
### resource uv_stdio_new(zval $fd, long $flags)
### resource uv_spawn(resource $loop, string $command, array $args, array $stdio, string $cwd, array $env = array(), callable $callback [,long $flags, array $options]) ### resource uv_spawn(resource $loop, string $command, array $args, array $stdio, string $cwd, array $env = array(), callable $callback [,long $flags, array $options])

View File

@ -10,7 +10,7 @@ $stdio[] = uv_stdio_new($in, UV::CREATE_PIPE | UV::READABLE_PIPE);
$stdio[] = uv_stdio_new($out, UV::CREATE_PIPE | UV::WRITABLE_PIPE); $stdio[] = uv_stdio_new($out, UV::CREATE_PIPE | UV::WRITABLE_PIPE);
$flags = 0; $flags = 0;
uv_spawn(uv_default_loop(), "php", array('-r','echo "WORLD";'), $stdio, "/usr/bin/", uv_spawn(uv_default_loop(), "php", array('-r','var_dump($_ENV);'), $stdio, "/usr/bin/",
array("key"=>"hello"), array("key"=>"hello"),
function($process, $stat, $signal){ function($process, $stat, $signal){
uv_close($process,function(){}); uv_close($process,function(){});

View File

@ -5067,7 +5067,7 @@ PHP_FUNCTION(uv_spawn)
tmp_env = Z_ARRVAL_P(env); tmp_env = Z_ARRVAL_P(env);
zenv = emalloc(sizeof(char*) * (zend_hash_num_elements(tmp_env)+1)); zenv = ecalloc(zend_hash_num_elements(tmp_env)+1, sizeof(char*));
for (zend_hash_internal_pointer_reset_ex(tmp_env, &pos); for (zend_hash_internal_pointer_reset_ex(tmp_env, &pos);
(key_type = zend_hash_get_current_key_ex(tmp_env, &key, &key_len, &key_index, 0, &pos)) != HASH_KEY_NON_EXISTANT; (key_type = zend_hash_get_current_key_ex(tmp_env, &key, &key_len, &key_index, 0, &pos)) != HASH_KEY_NON_EXISTANT;
zend_hash_move_forward_ex(tmp_env, &pos)) { zend_hash_move_forward_ex(tmp_env, &pos)) {