33namespace Backpack \CRUD \app \Console \Commands ;
44
55use Illuminate \Console \Command ;
6- use Symfony \Component \Process \Exception \ProcessFailedException ;
7- use Symfony \Component \Process \Process ;
86
97class Version extends Command
108{
@@ -30,7 +28,12 @@ class Version extends Command
3028 public function handle ()
3129 {
3230 $ this ->comment ('### PHP VERSION: ' );
33- $ this ->runConsoleCommand (['php ' , '-v ' ]);
31+ $ this ->line (phpversion ());
32+ $ this ->line ('' );
33+
34+ $ this ->comment ('### PHP EXTENSIONS: ' );
35+ $ this ->line (implode (', ' , get_loaded_extensions ()));
36+ $ this ->line ('' );
3437
3538 $ this ->comment ('### LARAVEL VERSION: ' );
3639 $ this ->line (\Composer \InstalledVersions::getVersion ('laravel/framework ' ));
@@ -44,27 +47,4 @@ public function handle()
4447 }
4548 }
4649 }
47-
48- /**
49- * Run a shell command in a separate process.
50- *
51- * @param array $command Text to be executed.
52- * @return void
53- */
54- private function runConsoleCommand ($ command )
55- {
56- $ process = new Process ($ command , null , null , null , 60 , null );
57- $ process ->run (function ($ type , $ buffer ) {
58- if (Process::ERR === $ type ) {
59- $ this ->line ($ buffer );
60- } else {
61- $ this ->line ($ buffer );
62- }
63- });
64-
65- // executes after the command finishes
66- if (! $ process ->isSuccessful ()) {
67- throw new ProcessFailedException ($ process );
68- }
69- }
7050}
0 commit comments