Go to file
2012-07-15 17:51:06 +09:00
examples now, uv_fs functions accepts php's stream, socket and fd 2012-07-15 03:56:29 +09:00
http-parser@9852e5d048 add http parser support: 2012-07-01 13:15:14 +09:00
libuv@171e2f71b9 use libuv v0.8.0. for now this can compile osx only. i'll fix it soon 2012-06-23 12:07:22 +09:00
tests add uv_fs_sendfile test case. 2012-07-15 00:45:06 +09:00
.gitignore adjust dtrace support 2012-07-14 22:57:18 +09:00
.gitmodules add http parser support: 2012-07-01 13:15:14 +09:00
.travis.yml missing notification parameter 2012-07-07 23:16:15 +09:00
config.m4 adjust dtrace support 2012-07-14 22:57:18 +09:00
config.w32 update config.w32: http-parser support 2012-07-01 13:47:26 +09:00
EXPERIMENTAL add experimental 2012-06-02 21:46:33 +09:00
Makefile.frag adjust dtrace support 2012-07-14 22:57:18 +09:00
php_uv.c add uv_loop_new 2012-07-15 17:51:06 +09:00
php_uv.h i don't have good solution for including php_sockets.h on windows box. for now comment out 2012-07-15 14:03:22 +09:00
phpunit.xml.dist isolate process for php tests 2012-06-25 10:45:20 +02:00
phpuv_dtrace.d dtrace just work on OSX box. Yay 2012-07-13 12:59:15 +09:00
README.md update readme [ci skip] 2012-07-02 00:51:08 +09:00
TODO.md don't support uv_once. 2012-07-15 01:26:15 +09:00
uv.c add poll api 2012-07-09 12:24:35 +09:00

php-uv

Build Status

interface to libuv for php (experimental). also supports http-parser.

Experimental

This extension is experimental, its functions may change their names or move to extension all together so do not rely to much on them you have been warned!

Install

git clone https://github.com/chobie/php-uv.git --recursive
cd php-uv
(cd libuv && make)
phpize
./configure
make
make install
# add `extension=uv.so` to your php.ini

Examples

see examples and tests directory.

<?php
$tcp = uv_tcp_init();

uv_tcp_bind($tcp, uv_ip4_addr('0.0.0.0',8888));

uv_listen($tcp,100, function($server){
    $client = uv_tcp_init();
    uv_accept($server, $client);
    var_dump(uv_tcp_getsockname($server));

    uv_read_start($client, function($socket, $nread, $buffer){
        var_dump($buffer);
        uv_close($socket);
    });
});

$c = uv_tcp_init();
uv_tcp_connect($c, uv_ip4_addr('0.0.0.0',8888), function($stream, $stat){
    if ($stat == 0) {
        uv_write($stream,"Hello",function($stream, $stat){
            uv_close($stream);
        });
    }
});

uv_run();

Community

Check out #php-uv on irc.freenode.net.

Author

  • Shuhei Tanuma

License

PHP License