Created
May 1, 2016 06:08
-
-
Save ratulcse10/ee71916d3b2223234fed50e0c3171f33 to your computer and use it in GitHub Desktop.
create symfony process in laravel project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Symfony\Component\Process\Process; | |
Route::get('test',function(){ | |
$process = new Process('sudo apt-get update'); | |
$process->run(); | |
// executes after the command finishes | |
if (!$process->isSuccessful()) { | |
throw new ProcessFailedException($process); | |
} | |
echo $process->getOutput(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment