&1'); $i++; $out[$i] = $tmp; $i++; } $currentTime = date( 'd-m-Y--h-i-s-a', time () ); file_put_contents(BASEPATH.'/gitlogs/git-'.$currentTime.'.txt', var_export($out, true)."\n\n"); //git push mirror array logs /** * Execute cmds in shell * @return array */ function pipeExecute($cmd, $input='') { $proc = proc_open($cmd, array( 0 => array('pipe','r'), 1 => array('pipe','w'), 2 => array('pipe','w') ), $pipes); fwrite($pipes[0], $input); fclose($pipes[0]); $stdout = stream_get_contents($pipes[1]); fclose($pipes[1]); $stderr = stream_get_contents($pipes[2]); fclose($pipes[2]); $rtn = proc_close($proc); return array( 'stdout'=>$stdout, 'stderr'=>$stderr, 'return'=>$rtn ); }