From 999ffdf12a260572defc81b0e7669d1cc2ccf3c4 Mon Sep 17 00:00:00 2001 From: Andrey Savchenko Date: Sun, 21 Apr 2013 19:07:56 +0300 Subject: [PATCH 1/2] Tweaked proc_open() call for callgraph to work on Windows. --- xhprof_lib/utils/callgraph_utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xhprof_lib/utils/callgraph_utils.php b/xhprof_lib/utils/callgraph_utils.php index b41eed6d..1a0526ca 100644 --- a/xhprof_lib/utils/callgraph_utils.php +++ b/xhprof_lib/utils/callgraph_utils.php @@ -109,7 +109,7 @@ function xhprof_generate_image_by_dot($dot_script, $type) { $cmd = " dot -T".$type; - $process = proc_open($cmd, $descriptorspec, $pipes, "/tmp", array()); + $process = proc_open( $cmd, $descriptorspec, $pipes, sys_get_temp_dir() ); if (is_resource($process)) { fwrite($pipes[0], $dot_script); fclose($pipes[0]); From 618899aff3ef18973327bd13cde2b6725d3ab745 Mon Sep 17 00:00:00 2001 From: Andrey Savchenko Date: Sat, 12 Apr 2014 14:32:53 +0300 Subject: [PATCH 2/2] Switched dot process environment to only receive PATH. --- xhprof_lib/utils/callgraph_utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xhprof_lib/utils/callgraph_utils.php b/xhprof_lib/utils/callgraph_utils.php index 1a0526ca..b255c2a2 100644 --- a/xhprof_lib/utils/callgraph_utils.php +++ b/xhprof_lib/utils/callgraph_utils.php @@ -109,7 +109,7 @@ function xhprof_generate_image_by_dot($dot_script, $type) { $cmd = " dot -T".$type; - $process = proc_open( $cmd, $descriptorspec, $pipes, sys_get_temp_dir() ); + $process = proc_open( $cmd, $descriptorspec, $pipes, sys_get_temp_dir(), array( 'PATH' => getenv( 'PATH' ) ) ); if (is_resource($process)) { fwrite($pipes[0], $dot_script); fclose($pipes[0]);