fix cwd within sudo
[pharext/pharext] / src / pharext / ExecCmd.php
index 5a6ee81f6fdad1be6b6eb4756d3c5cf966de58ae..f16d105dd30c808d9ab0a18ee2f26255737ce34a 100644 (file)
@@ -61,7 +61,7 @@ class ExecCmd
         * @return int exit status
         */
        private function suExec($command, $verbose = null) {
-               if (!($proc = proc_open($command, [STDIN,["pipe","w"],["pipe","w"]], $pipes))) {
+               if (!($proc = proc_open($command, [STDIN,["pipe","w"],["pipe","w"]], $pipes, getcwd()))) {
                        $this->status = -1;
                        throw new Exception("Failed to run {$command}");
                }