From 8b07f620f11968046db6072110a735c3a3f79a6e Mon Sep 17 00:00:00 2001 From: Deltik Date: Tue, 20 Feb 2018 21:05:18 -0600 Subject: [PATCH] Reworked E107Base::cleanVCS() to use proc_open() Maybe works on Windows now? Author doesn't know; author coded this on Linux. --- tests/_support/Helper/E107Base.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/_support/Helper/E107Base.php b/tests/_support/Helper/E107Base.php index 8c6d41472..1e548e908 100644 --- a/tests/_support/Helper/E107Base.php +++ b/tests/_support/Helper/E107Base.php @@ -51,9 +51,20 @@ abstract class E107Base extends Base protected function cleanVCS() { - $pwd = getcwd(); - chdir(APP_PATH); - exec('git clean -fdx'); - chdir($pwd); + $descriptorspec = [ + 1 => ['pipe', 'w'], + 2 => ['pipe', 'w'], + ]; + $pipes = []; + $resource = proc_open('git clean -fdx', $descriptorspec, $pipes, APP_PATH); + //$stdout = stream_get_contents($pipes[1]); + //$stderr = stream_get_contents($pipes[2]); + //foreach ($pipes as $pipe) + //{ + // fclose($pipe); + //} + //var_dump($stdout); + //var_dump($stderr); + proc_close($resource); } }