From: Sara Golemon Date: Mon, 2 Oct 2006 21:02:08 +0000 (+0000) Subject: Flag the easy stuff out of the way, proc_open() is the real beast in here X-Git-Tag: RELEASE_1_0_0RC1~1469 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=260836ec7abc7579383ab515dce609c30e723a4b;p=php Flag the easy stuff out of the way, proc_open() is the real beast in here --- diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 62adfbd38e..d99996078f 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -253,7 +253,7 @@ PHP_MINIT_FUNCTION(proc_open) } /* }}} */ -/* {{{ proto int proc_terminate(resource process [, long signal]) +/* {{{ proto int proc_terminate(resource process [, long signal]) U kill a process opened by proc_open */ PHP_FUNCTION(proc_terminate) { @@ -278,7 +278,7 @@ PHP_FUNCTION(proc_terminate) } /* }}} */ -/* {{{ proto int proc_close(resource process) +/* {{{ proto int proc_close(resource process) U close a process opened by proc_open */ PHP_FUNCTION(proc_close) { @@ -296,7 +296,7 @@ PHP_FUNCTION(proc_close) } /* }}} */ -/* {{{ proto array proc_get_status(resource process) +/* {{{ proto array proc_get_status(resource process) U get information about a process opened by proc_open */ PHP_FUNCTION(proc_get_status) { @@ -319,7 +319,19 @@ PHP_FUNCTION(proc_get_status) array_init(return_value); - add_ascii_assoc_string(return_value, "command", proc->command, 1); + if (UG(unicode)) { + UChar *ucmd; + int ucmd_len; + + if (SUCCESS == php_stream_path_decode(&php_plain_files_wrapper, &ucmd, &ucmd_len, proc->command, strlen(proc->command), REPORT_ERRORS, FG(default_context))) { + add_ascii_assoc_unicodel(return_value, "command", ucmd, ucmd_len, 0); + } else { + /* Fallback on original binary string */ + add_ascii_assoc_string(return_value, "command", proc->command, 1); + } + } else { + add_ascii_assoc_string(return_value, "command", proc->command, 1); + } add_ascii_assoc_long(return_value, "pid", (long) proc->child); #ifdef PHP_WIN32