From c164524e61850d2175c0cb40d163843255a1ee54 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Thu, 2 Jan 2014 18:17:08 -0500 Subject: [PATCH 1/5] update joyent/http-parser to v.2.2 --- http-parser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http-parser b/http-parser index e77957a..fd609ab 160000 --- a/http-parser +++ b/http-parser @@ -1 +1 @@ -Subproject commit e77957a091719e98ef2fe1fccfe2e89c9b46f034 +Subproject commit fd609ab272f94bb58e65449b4faeaa4abe02b558 From 5000a99b895d84542db76cb002a8719548eaab39 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Thu, 2 Jan 2014 18:17:29 -0500 Subject: [PATCH 2/5] update joyent/libuv to v0.10.21 --- libuv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libuv b/libuv index 86ae8b3..375ebce 160000 --- a/libuv +++ b/libuv @@ -1 +1 @@ -Subproject commit 86ae8b3c639bef040625dba03d842298746ca01b +Subproject commit 375ebce068555f0ca8151b562edb5f1b263022db From 14d80970bffb5d8d29c050e06027ba6fa390061f Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Thu, 2 Jan 2014 18:19:28 -0500 Subject: [PATCH 3/5] uv.a is now called libuv.a --- .travis.yml | 2 +- README.md | 264 ++++++++++++++++++++++++++-------------------------- config.m4 | 4 +- 3 files changed, 133 insertions(+), 137 deletions(-) diff --git a/.travis.yml b/.travis.yml index 69e0e3e..3118cbb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ php: - 5.5 before_script: - - cd libuv && make uv.a CFLAGS=-fPIC -s && cd .. + - cd libuv && make libuv.a CFLAGS=-fPIC -s && cd .. - phpize && ./configure && make && sudo make install - echo "extension=uv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` diff --git a/README.md b/README.md index ffb6517..3fe0876 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ interface to libuv for php (experimental). also supports http-parser. # Experimental -This extension is experimental, its functions may change their names +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 @@ -15,7 +15,7 @@ or move to extension all together so do not rely to much on them you have been w git clone https://github.com/chobie/php-uv.git --recursive cd php-uv (cd libuv && make) -# Note: please use `make uv.a CFLAGS=-fPIC` instead of `make` on 64bit box. +# Note: please use `make libuv.a CFLAGS=-fPIC` instead of `make` on 64bit box. phpize ./configure make @@ -104,7 +104,7 @@ get last error code. ##### *Parameters* -*resource $uv_loop*: uv loop handle +*resource $uv_loop*: uv loop handle ##### *Return Value* @@ -181,7 +181,7 @@ increment reference count ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -209,7 +209,7 @@ run event loop ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -243,7 +243,7 @@ delete specified loop resource. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -266,7 +266,7 @@ binds a name to a socket. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -305,7 +305,7 @@ binds a name to a socket. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -343,7 +343,7 @@ send buffer to speicified uv resource. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -366,7 +366,7 @@ set Nagel's flags for specified tcp resource. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -391,7 +391,7 @@ accepts a connection on a socket. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -429,7 +429,7 @@ shutdown uv handle. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -448,7 +448,7 @@ close uv handle. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -468,7 +468,7 @@ starts read callback for uv resources. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -494,7 +494,7 @@ stop read callback ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -635,7 +635,7 @@ connect to specified ip address and port. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -664,7 +664,7 @@ connect to specified ip address and port. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -717,7 +717,7 @@ initialize timer handle. ##### *Return Value* -*void: +*void: ##### *Example* @@ -794,7 +794,7 @@ set repeat count. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -812,7 +812,7 @@ returns repeat interval. ##### *Return Value* -*long $repeat_time*: +*long $repeat_time*: ##### *Example* @@ -1037,7 +1037,7 @@ uv_udp_bind($udp, uv_ip4_addr('0.0.0.0',10000)); uv_udp_recv_start($udp,function($stream, $nread, $buffer){ echo "recv:" . $buffer; - + uv_close($stream); }); @@ -1081,7 +1081,7 @@ uv_udp_bind6($udp, uv_ip6_addr('::1',10000)); uv_udp_recv_start($udp,function($stream, $nread, $buffer){ echo "recv:" . $buffer; - + uv_close($stream); }); @@ -1123,7 +1123,7 @@ uv_udp_bind6($udp, uv_ip6_addr('::1',10000)); uv_udp_recv_start($udp,function($stream, $nread, $buffer){ echo "recv:" . $buffer; - + uv_close($stream); }); @@ -1188,11 +1188,11 @@ set multicast loop *resource $handle*: uv resource handle (udp) -*long $enabled*: +*long $enabled*: ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -1212,7 +1212,7 @@ set multicast ttl ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -1228,11 +1228,11 @@ set udp broadcast *resource $handle*: uv resource handle (udp) -*long $enabled*: +*long $enabled*: ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -1269,7 +1269,7 @@ uv_udp_bind($udp, uv_ip4_addr('::1',10000)); uv_udp_recv_start($udp,function($stream, $nread, $buffer){ echo "recv:" . $buffer; - + uv_close($stream); }); @@ -1314,7 +1314,7 @@ uv_udp_bind6($udp, uv_ip6_addr('::1',10000)); uv_udp_recv_start($udp,function($stream, $nread, $buffer){ echo "recv:" . $buffer; - + uv_close($stream); }); @@ -1390,7 +1390,7 @@ initialize pipe resource ##### *Return Value* -*resource $uv_pipe*: +*resource $uv_pipe*: ##### *Example* @@ -1415,7 +1415,7 @@ open a pipe resource. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -1435,7 +1435,7 @@ create a named pipe. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -1457,7 +1457,7 @@ connect to named pipe. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -1494,7 +1494,7 @@ retunrs current loadaverage. ##### *Return Value* -*array $loadaverage*: +*array $loadaverage*: ##### *Example* @@ -1527,7 +1527,7 @@ returns current uptime. ##### *Return Value* -*long $uptime*: +*long $uptime*: ##### *Example* @@ -1549,7 +1549,7 @@ returns current free memory size. ##### *Return Value* -*long $free*: +*long $free*: ##### *Example* @@ -1571,7 +1571,7 @@ returns total memory size. ##### *Return Value* -*long $free*: +*long $free*: ##### *Example* @@ -1601,7 +1601,7 @@ returns current exepath. basically this will returns current php path. ##### *Return Value* -*string $exepath*: +*string $exepath*: ##### *Example* @@ -1623,7 +1623,7 @@ returns current working directory. ##### *Return Value* -*string $cwd*: +*string $cwd*: ##### *Example* @@ -1647,7 +1647,7 @@ returns current cpu informations ##### *Return Value* -*array $cpu_info*: +*array $cpu_info*: ##### *Example* @@ -1696,11 +1696,11 @@ send signal to specified uv process resource. *resource $handle*: uv resource handle (process) -*long $signal*: +*long $signal*: ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -1720,7 +1720,7 @@ send signal to specified pid. ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -1738,7 +1738,7 @@ change working directory. ##### *Return Value* -*bool *: +*bool *: ##### *Example* @@ -1772,7 +1772,7 @@ set read lock ##### *Return Value* -*void *: +*void *: ##### *Example* @@ -1798,7 +1798,7 @@ unlock read lock ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -1816,7 +1816,7 @@ set write lock ##### *Return Value* -*void *: +*void *: ##### *Example* @@ -1842,7 +1842,7 @@ unlock write lock ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -1876,7 +1876,7 @@ lock mutex ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -1900,7 +1900,7 @@ initialize semaphore resource ##### *Return Value* -*resource $uv_sem*: +*resource $uv_sem*: ##### *Example* @@ -1918,7 +1918,7 @@ post semaphore ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -2060,7 +2060,7 @@ $i = 0; uv_idle_start($idle, function($stat) use (&$i, $idle, $loop){ echo "count: {$i}" . PHP_EOL; $i++; - + if ($i > 3) { uv_idle_stop($idle); } @@ -2102,7 +2102,7 @@ setup async callback *resource $loop*: uv loop resource -*callback $callback*: +*callback $callback*: ##### *Return Value* @@ -2124,7 +2124,7 @@ send async callback immidiately ##### *Return Value* -*void*: +*void*: ##### *Example* @@ -2154,13 +2154,13 @@ open specified file ##### *Return Value* -*void*: +*void*: ##### *Example* ````php Date: Thu, 2 Jan 2014 18:22:12 -0500 Subject: [PATCH 4/5] uv_run now needs a mode, use UV_RUN_DEFAULT --- php_uv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php_uv.c b/php_uv.c index 4b8061d..ea1fb87 100644 --- a/php_uv.c +++ b/php_uv.c @@ -3374,7 +3374,7 @@ PHP_FUNCTION(uv_run) } PHP_UV_FETCH_UV_DEFAULT_LOOP(loop, zloop); //TODO: implement this - uv_run(loop); + uv_run(loop, UV_RUN_DEFAULT); } /* }}} */ From 9e0935aa912554c7fc6a9ada6a95e76bd3d5eb1e Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Thu, 2 Jan 2014 18:23:30 -0500 Subject: [PATCH 5/5] bump version to 0.0.2 --- php_uv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php_uv.h b/php_uv.h index 595327e..384f9d4 100644 --- a/php_uv.h +++ b/php_uv.h @@ -3,7 +3,7 @@ #define PHP_UV_H #define PHP_UV_EXTNAME "uv" -#define PHP_UV_EXTVER "0.0.1" +#define PHP_UV_EXTVER "0.0.2" #ifdef HAVE_CONFIG_H #include "config.h"