mirror of
https://github.com/danog/ext-uv.git
synced 2024-11-26 20:14:47 +01:00
improve several things
This commit is contained in:
parent
6eaff02395
commit
6f4331d0f5
@ -1,6 +1,5 @@
|
||||
phpuv_dtrace.h:
|
||||
dtrace -h -s $(srcdir)/phpuv_dtrace.d; \
|
||||
|
||||
$(srcdir)/libuv/uv.a:
|
||||
$(srcdir)/libuv/libuv.a:
|
||||
$(MAKE) -C $(srcdir)/libuv
|
||||
cp $(srcdir)/libuv/uv.a $(srcdir)/libuv/libuv.a
|
||||
|
@ -14,8 +14,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 libuv.a CFLAGS=-fPIC` instead of `make` on 64bit box.
|
||||
make -C libuv
|
||||
phpize
|
||||
./configure
|
||||
make
|
||||
|
@ -22,7 +22,6 @@ fi
|
||||
if test "$PHP_UV_DEBUG" != "no"; then
|
||||
CFLAGS="$CFLAGS -Wall -g -ggdb -O0 -DPHP_UV_DEBUG=1"
|
||||
AC_DEFINE(PHP_UV_DEBUG, 1, [Enable uv debug support])
|
||||
echo "damepo"
|
||||
fi
|
||||
|
||||
if test "$PHP_DTRACE" != "no"; then
|
||||
|
21
php_uv.c
21
php_uv.c
@ -198,8 +198,6 @@ static uv_loop_t *_php_uv_default_loop;
|
||||
|
||||
static int uv_resource_handle;
|
||||
|
||||
static int uv_ares_handle;
|
||||
|
||||
static int uv_loop_handle;
|
||||
|
||||
static int uv_sockaddr_handle;
|
||||
@ -210,8 +208,6 @@ static int uv_httpparser_handle;
|
||||
|
||||
static int uv_stdio_handle;
|
||||
|
||||
static int uv_ares_initialized;
|
||||
|
||||
|
||||
char *php_uv_resource_map[IS_UV_MAX] = {
|
||||
"uv_tcp",
|
||||
@ -1662,7 +1658,7 @@ static void php_uv_work_cb(uv_work_t* req)
|
||||
PHP_UV_DEBUG_RESOURCE_REFCOUNT(uv_work_cb, uv->resource_id);
|
||||
}
|
||||
|
||||
static void php_uv_after_work_cb(uv_work_t* req)
|
||||
static void php_uv_after_work_cb(uv_work_t* req, int status)
|
||||
{
|
||||
zval *retval_ptr = NULL;
|
||||
php_uv_t *uv = (php_uv_t*)req->data;
|
||||
@ -3361,20 +3357,20 @@ PHP_FUNCTION(uv_ref)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto void uv_run([resource $uv_loop])
|
||||
/* {{{ proto void uv_run([resource $uv_loop, long $run_mode])
|
||||
*/
|
||||
PHP_FUNCTION(uv_run)
|
||||
{
|
||||
zval *zloop = NULL;
|
||||
uv_loop_t *loop;
|
||||
long run_mode = UV_RUN_DEFAULT;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
|
||||
"|z",&zloop) == FAILURE) {
|
||||
"|zl",&zloop, &run_mode) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
PHP_UV_FETCH_UV_DEFAULT_LOOP(loop, zloop);
|
||||
//TODO: implement this
|
||||
uv_run(loop, UV_RUN_DEFAULT);
|
||||
uv_run(loop, run_mode);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@ -3386,12 +3382,13 @@ PHP_FUNCTION(uv_run_once)
|
||||
uv_loop_t *loop;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
|
||||
"|z",&zloop) == FAILURE) {
|
||||
"|z", &zloop) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "uv_run_once is deprecated; use uv_run(uv_default_loop(), UV::RUN_ONCE) instead");
|
||||
|
||||
PHP_UV_FETCH_UV_DEFAULT_LOOP(loop, zloop);
|
||||
|
||||
RETURN_LONG(uv_run_once(loop));
|
||||
RETURN_LONG(uv_run(loop, UV_RUN_ONCE));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
4
uv.c
4
uv.c
@ -34,6 +34,10 @@ static int php_uv_class_init(TSRMLS_D)
|
||||
uv_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
|
||||
//uv_class_entry->create_object = php_uv_new;
|
||||
|
||||
zend_declare_class_constant_long(uv_class_entry, "RUN_DEFAULT", sizeof("RUN_DEFAULT")-1, UV_RUN_DEFAULT TSRMLS_CC);
|
||||
zend_declare_class_constant_long(uv_class_entry, "RUN_ONCE", sizeof("RUN_ONCE")-1, UV_RUN_ONCE TSRMLS_CC);
|
||||
zend_declare_class_constant_long(uv_class_entry, "RUN_NOWAIT", sizeof("RUN_NOWAIT")-1, UV_RUN_NOWAIT TSRMLS_CC);
|
||||
|
||||
zend_declare_class_constant_long(uv_class_entry, "CHANGE", sizeof("CHANGE")-1, UV_CHANGE TSRMLS_CC);
|
||||
zend_declare_class_constant_long(uv_class_entry, "RENAME", sizeof("RENAME")-1, UV_RENAME TSRMLS_CC);
|
||||
zend_declare_class_constant_long(uv_class_entry, "READABLE",sizeof("READABLE")-1, UV_READABLE TSRMLS_CC);
|
||||
|
Loading…
Reference in New Issue
Block a user