diff --git a/examples/check.php b/examples/check.php index 43c2fcc..aa63aaa 100644 --- a/examples/check.php +++ b/examples/check.php @@ -5,7 +5,7 @@ $check = uv_check_init($loop); $idle = uv_idle_init(); $i = 0; -uv_idle_start($idle, function($stat) use (&$i, $idle, $loop){ +uv_idle_start($idle, function($status) use (&$i, $idle, $loop){ echo "count: {$i}" . PHP_EOL; $i++; @@ -15,8 +15,8 @@ uv_idle_start($idle, function($stat) use (&$i, $idle, $loop){ sleep(1); }); -uv_check_start($check, function($check, $status){ - echo "Hello"; +uv_check_start($check, function($check) { + echo "Hello\n"; uv_check_stop($check); }); diff --git a/examples/chmod.php b/examples/chmod.php index 7333f81..310f603 100644 --- a/examples/chmod.php +++ b/examples/chmod.php @@ -1,6 +1,6 @@ UV::AF_UNSPEC )); diff --git a/examples/gethostbyname.php b/examples/gethostbyname.php deleted file mode 100644 index d8e67cd..0000000 --- a/examples/gethostbyname.php +++ /dev/null @@ -1,14 +0,0 @@ - array( - "8.8.8.8" - ), - "port"=>53 -),null); - -ares_gethostbyname($uv,"google.com",AF_INET, function($name, $addr){ - var_dump($name); - var_dump($addr); -}); - -uv_run(); diff --git a/examples/idle.php b/examples/idle.php index 12ac8d4..d0ba178 100644 --- a/examples/idle.php +++ b/examples/idle.php @@ -3,7 +3,7 @@ $loop = uv_default_loop(); $idle = uv_idle_init(); $i = 0; -uv_idle_start($idle, function($stat) use (&$i, $idle, $loop){ +uv_idle_start($idle, function($stat) use (&$i, $idle, $loop) { echo "count: {$i}" . PHP_EOL; $i++; diff --git a/examples/lstat.php b/examples/lstat.php index bd6bdbb..0b28335 100644 --- a/examples/lstat.php +++ b/examples/lstat.php @@ -1,7 +1,7 @@ array( - "8.8.8.8" - ), - "port"=>53 -),null); - -ares_gethostbyname($uv,$domain, AF_INET, function($name, $addr) use ($path, $host){ - $a = array_shift($addr); - $address = uv_ip4_addr($a,"80"); - $tcp = uv_tcp_init(); - - uv_tcp_connect($tcp, $address, function($client, $stat) use ($path, $host){ - var_dump(uv_tcp_getpeername($client)); - - $request = <<"hello"), +uv_spawn(uv_default_loop(), "php", ['-r', 'var_dump($_ENV);'], $stdio, "/usr/bin/", + ["key" => "hello"], function($process, $stat, $signal){ uv_close($process,function(){}); -}, $flags); + }, $flags); - -uv_run(); \ No newline at end of file +uv_run(); diff --git a/examples/stat.php b/examples/stat.php index d3cefcf..f8948f7 100644 --- a/examples/stat.php +++ b/examples/stat.php @@ -1,7 +1,7 @@