Skip to content

Commit 61d4f2b

Browse files
authored
[11.x] Utilise Illuminate\Support\php_binary() (#53008)
Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent 8f2d056 commit 61d4f2b

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/Illuminate/Foundation/Console/ApiInstallCommand.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
use Illuminate\Filesystem\Filesystem;
77
use Illuminate\Support\Facades\Process;
88
use Symfony\Component\Console\Attribute\AsCommand;
9-
use Symfony\Component\Process\PhpExecutableFinder;
9+
10+
use function Illuminate\Support\php_binary;
1011

1112
#[AsCommand(name: 'install:api')]
1213
class ApiInstallCommand extends Command
@@ -65,7 +66,7 @@ public function handle()
6566

6667
if ($this->option('passport')) {
6768
Process::run(array_filter([
68-
(new PhpExecutableFinder())->find(false) ?: 'php',
69+
php_binary(),
6970
defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan',
7071
'passport:install',
7172
$this->confirm('Would you like to use UUIDs for all client IDs?') ? '--uuids' : null,
@@ -130,7 +131,7 @@ protected function installSanctum()
130131

131132
if (! $migrationPublished) {
132133
Process::run([
133-
(new PhpExecutableFinder())->find(false) ?: 'php',
134+
php_binary(),
134135
defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan',
135136
'vendor:publish',
136137
'--provider',

src/Illuminate/Foundation/Console/BroadcastingInstallCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
use Illuminate\Filesystem\Filesystem;
88
use Illuminate\Support\Facades\Process;
99
use Symfony\Component\Console\Attribute\AsCommand;
10-
use Symfony\Component\Process\PhpExecutableFinder;
1110

11+
use function Illuminate\Support\php_binary;
1212
use function Laravel\Prompts\confirm;
1313

1414
#[AsCommand(name: 'install:broadcasting')]
@@ -155,7 +155,7 @@ protected function installReverb()
155155
]);
156156

157157
Process::run([
158-
(new PhpExecutableFinder())->find(false) ?: 'php',
158+
php_binary(),
159159
defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan',
160160
'reverb:install',
161161
]);

src/Illuminate/Foundation/Console/ServeCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
use Illuminate\Support\InteractsWithTime;
99
use Symfony\Component\Console\Attribute\AsCommand;
1010
use Symfony\Component\Console\Input\InputOption;
11-
use Symfony\Component\Process\PhpExecutableFinder;
1211
use Symfony\Component\Process\Process;
1312

13+
use function Illuminate\Support\php_binary;
1414
use function Termwind\terminal;
1515

1616
#[AsCommand(name: 'serve')]
@@ -178,7 +178,7 @@ protected function serverCommand()
178178
: __DIR__.'/../resources/server.php';
179179

180180
return [
181-
(new PhpExecutableFinder)->find(false) ?: 'php',
181+
php_binary(),
182182
'-S',
183183
$this->host().':'.$this->port(),
184184
$server,

0 commit comments

Comments
 (0)