public function patch() { if ($this->diff) { $patchFile = $this->getPatchFilename(); file_put_contents($patchFile, $this->diff); system("patch < {$patchFile}"); // clean up patch File unlink($patchFile); } }