Skip to content

Commit

Permalink
[11.x] Utilise Illuminate\Support\php_binary() (#53008)
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone authored Oct 2, 2024
1 parent 8f2d056 commit 61d4f2b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/Illuminate/Foundation/Console/ApiInstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Process;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Process\PhpExecutableFinder;

use function Illuminate\Support\php_binary;

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

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

if (! $migrationPublished) {
Process::run([
(new PhpExecutableFinder())->find(false) ?: 'php',
php_binary(),
defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan',
'vendor:publish',
'--provider',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Process;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Process\PhpExecutableFinder;

use function Illuminate\Support\php_binary;
use function Laravel\Prompts\confirm;

#[AsCommand(name: 'install:broadcasting')]
Expand Down Expand Up @@ -155,7 +155,7 @@ protected function installReverb()
]);

Process::run([
(new PhpExecutableFinder())->find(false) ?: 'php',
php_binary(),
defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan',
'reverb:install',
]);
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Console/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
use Illuminate\Support\InteractsWithTime;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\Process;

use function Illuminate\Support\php_binary;
use function Termwind\terminal;

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

return [
(new PhpExecutableFinder)->find(false) ?: 'php',
php_binary(),
'-S',
$this->host().':'.$this->port(),
$server,
Expand Down

0 comments on commit 61d4f2b

Please sign in to comment.