Skip to content

Commit 63f6344

Browse files
authored
Merge pull request #5338 from makss/fix-php-version
PHP version detection fix.
2 parents 3ecaeff + 1287650 commit 63f6344

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

src/app/Console/Commands/Version.php

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
namespace Backpack\CRUD\app\Console\Commands;
44

55
use Illuminate\Console\Command;
6-
use Symfony\Component\Process\Exception\ProcessFailedException;
7-
use Symfony\Component\Process\Process;
86

97
class 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

Comments
 (0)