Skip to content

Commit 84483c6

Browse files
authored
Merge pull request #20 from ZsgsDesign/master
fixed several compatibility issues with windows and php-cgi, see #15
2 parents 72bd03a + 3853293 commit 84483c6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Scheduling.php

+13
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ protected function formatTask($event)
7575
];
7676
}
7777

78+
if (PHP_OS_FAMILY === 'Windows' && Str::contains($event->command, '"artisan"')) {
79+
$exploded = explode(' ', $event->command);
80+
81+
return [
82+
'type' => 'artisan',
83+
'name' => 'artisan '.implode(' ', array_slice($exploded, 2)),
84+
];
85+
}
86+
7887
return [
7988
'type' => 'command',
8089
'name' => $event->command,
@@ -95,6 +104,10 @@ public function runTask($id)
95104
/** @var \Illuminate\Console\Scheduling\Event $event */
96105
$event = $this->getKernelEvents()[$id - 1];
97106

107+
if (PHP_OS_FAMILY === 'Windows') {
108+
$event->command = Str::of($event->command)->replace('php-cgi.exe', 'php.exe');
109+
}
110+
98111
$event->sendOutputTo($this->getOutputTo());
99112

100113
$event->run(app());

0 commit comments

Comments
 (0)