mirror of
https://github.com/danog/ext-uv.git
synced 2024-11-26 20:14:47 +01:00
90c9db6905
Notes: ares functions are removed as uv removed that features. please use before commit if you want to use ares features. currently, php ares extension seems not maintained. please ask me when you met some troubles about ares feature.
24 lines
562 B
PHP
24 lines
562 B
PHP
--TEST--
|
|
Check for fs read and close
|
|
--FILE--
|
|
<?php
|
|
define("FIXTURE_PATH", dirname(__FILE__) . "/fixtures/hello.data");
|
|
|
|
uv_fs_open(uv_default_loop(),FIXTURE_PATH, UV::O_RDONLY, 0, function($r){
|
|
uv_fs_read(uv_default_loop(),$r,32,function($stream, $nread, $data) {
|
|
if ($nread <= 0) {
|
|
if ($nread < 0) {
|
|
throw new Exception("read error");
|
|
}
|
|
|
|
uv_fs_close(uv_default_loop(), $stream, function(){
|
|
});
|
|
} else {
|
|
echo $data;
|
|
}
|
|
});
|
|
});
|
|
|
|
uv_run();
|
|
--EXPECT--
|
|
Hello |