pollita Mon Oct 2 21:02:08 2006 UTC Modified files: /php-src/ext/standard proc_open.c Log: Flag the easy stuff out of the way, proc_open() is the real beast in here http://cvs.php.net/viewvc.cgi/php-src/ext/standard/proc_open.c?r1=1.43&r2=1.44&diff_format=u Index: php-src/ext/standard/proc_open.c diff -u php-src/ext/standard/proc_open.c:1.43 php-src/ext/standard/proc_open.c:1.44 --- php-src/ext/standard/proc_open.c:1.43 Tue Sep 19 10:38:31 2006 +++ php-src/ext/standard/proc_open.c Mon Oct 2 21:02:08 2006 @@ -15,7 +15,7 @@ | Author: Wez Furlong <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: proc_open.c,v 1.43 2006/09/19 10:38:31 dmitry Exp $ */ +/* $Id: proc_open.c,v 1.44 2006/10/02 21:02:08 pollita Exp $ */ #if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__)) # define _BSD_SOURCE /* linux wants this when XOPEN mode is on */ @@ -253,7 +253,7 @@ } /* }}} */ -/* {{{ 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 @@ } /* }}} */ -/* {{{ 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 @@ } /* }}} */ -/* {{{ 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 @@ 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
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php