From fefcce320613944c3b8ff32dad549d00845a09a0 Mon Sep 17 00:00:00 2001 From: Kekalainen Date: Thu, 21 Apr 2022 19:31:54 +0300 Subject: [PATCH 1/2] Fix schedule:work command Artisan binary name --- .../Console/Scheduling/ScheduleWorkCommand.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Console/Scheduling/ScheduleWorkCommand.php b/src/Illuminate/Console/Scheduling/ScheduleWorkCommand.php index f30a2f0c9086..b75e8b8f0e85 100644 --- a/src/Illuminate/Console/Scheduling/ScheduleWorkCommand.php +++ b/src/Illuminate/Console/Scheduling/ScheduleWorkCommand.php @@ -38,7 +38,7 @@ public function handle() if (Carbon::now()->second === 0 && ! Carbon::now()->startOfMinute()->equalTo($lastExecutionStartedAt)) { - $executions[] = $execution = new Process([PHP_BINARY, 'artisan', 'schedule:run']); + $executions[] = $execution = new Process([PHP_BINARY, static::artisanBinary(), 'schedule:run']); $execution->start(); @@ -65,4 +65,14 @@ public function handle() } } } + + /** + * Get the name of the Artisan binary. + * + * @return string + */ + protected static function artisanBinary() + { + return defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan'; + } } From f41839b8195a6187f51913b7315904330d123404 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 21 Apr 2022 17:13:41 -0500 Subject: [PATCH 2/2] formatting --- .../Console/Scheduling/ScheduleWorkCommand.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/Illuminate/Console/Scheduling/ScheduleWorkCommand.php b/src/Illuminate/Console/Scheduling/ScheduleWorkCommand.php index b75e8b8f0e85..db0925f7b08d 100644 --- a/src/Illuminate/Console/Scheduling/ScheduleWorkCommand.php +++ b/src/Illuminate/Console/Scheduling/ScheduleWorkCommand.php @@ -38,7 +38,11 @@ public function handle() if (Carbon::now()->second === 0 && ! Carbon::now()->startOfMinute()->equalTo($lastExecutionStartedAt)) { - $executions[] = $execution = new Process([PHP_BINARY, static::artisanBinary(), 'schedule:run']); + $executions[] = $execution = new Process([ + PHP_BINARY, + defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan', + 'schedule:run' + ]); $execution->start(); @@ -65,14 +69,4 @@ public function handle() } } } - - /** - * Get the name of the Artisan binary. - * - * @return string - */ - protected static function artisanBinary() - { - return defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan'; - } }