/**
  * Low-level helper, generally use runShellCommand()
  *
  * @param $cmd
  * @return array
  */
 private function runProcess($cmd)
 {
     /*
      * MAMP / XAMPP issue on Mac OS X, see #106.
      *
      * http://stackoverflow.com/a/16903162/1243495
      */
     $dyldLibraryPath = getenv("DYLD_LIBRARY_PATH");
     if ($dyldLibraryPath != "") {
         putenv("DYLD_LIBRARY_PATH=");
     }
     $process = new Process($cmd, $this->workingDirectoryRoot);
     if ($this->gitProcessTimeout !== null) {
         $process->setTimeout($this->gitProcessTimeout);
     }
     $process->run();
     $result = ['stdout' => $process->getOutput(), 'stderr' => $process->getErrorOutput()];
     putenv("DYLD_LIBRARY_PATH={$dyldLibraryPath}");
     if ($result['stdout'] !== null) {
         $result['stdout'] = trim($result['stdout']);
     }
     if ($result['stderr'] !== null) {
         $result['stderr'] = trim($result['stderr']);
     }
     return $result;
 }