mirror of
https://github.com/danog/ext-uv.git
synced 2024-11-26 20:14:47 +01:00
docs: add uv_stdio_new function
This commit is contained in:
parent
4dd2ed56fa
commit
be24fe6155
@ -1680,6 +1680,7 @@ var_dump(uv_cpu_info());
|
||||
|
||||
### 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])
|
||||
|
||||
|
@ -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);
|
||||
|
||||
$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"),
|
||||
function($process, $stat, $signal){
|
||||
uv_close($process,function(){});
|
||||
|
2
php_uv.c
2
php_uv.c
@ -5067,7 +5067,7 @@ PHP_FUNCTION(uv_spawn)
|
||||
|
||||
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);
|
||||
(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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user