Advertisement
Guest User

Untitled

a guest
May 1st, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. use Symfony\Component\Process\Process;
  2.  
  3. Route::get('test',function(){
  4. $process = new Process('sudo apt-get update');
  5. $process->run();
  6.  
  7. // executes after the command finishes
  8. if (!$process->isSuccessful()) {
  9. throw new ProcessFailedException($process);
  10. }
  11.  
  12. echo $process->getOutput();
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement