Skip to content

Instantly share code, notes, and snippets.

@samjarrett
Last active December 26, 2015 17:59
Show Gist options
  • Save samjarrett/b0189a82e5fd46e250f1 to your computer and use it in GitHub Desktop.
Save samjarrett/b0189a82e5fd46e250f1 to your computer and use it in GitHub Desktop.
#melbsf2 Symfony Components: Using the Process component (see http://samjarrett.github.io/Symfony2-Components-Presentation/pres.html)
<?php
use Symfony\Component\Process\Process;
$process = new Process('svn2git ' . $svnHref);
$process->setTimeout(3600);
$process->run(function ($type, $buffer) {
if (Process::ERR === $type) {
$output->write('<error>' . $buffer . '</error>');
} else {
$output->write($buffer); // $buffer will include EOL
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment