laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.32k stars 10.95k forks source link

Illuminate\Console\Scheduling\Schedule::command() Should Enclose PHP_BINARY in Double Quotes if it Contains Spaces #10187

Closed voidstate closed 8 years ago

voidstate commented 9 years ago

It is common on Windows to have spaces in file paths, for example when PHP is installed via Microsoft's Web Platform Installer, it is found at C:\Program Files (x86)\PHP\v5.6\php.exe.

Using $schedule->command in the console kernal fails in this case. But if the path is enclosed in double quotes, it does not fail.

Changing laravel\framework\src\Illuminate\Console\Scheduling\Schedule.php (line 45) to this allows scheduled tasks to run on Windows:

return $this->exec('"'.PHP_BINARY.'" "'.$artisan.'" '.$command, $parameters);

GrahamCampbell commented 9 years ago

I really tried to have that done but Taylor rejected the idea of correctly escaping the path.

GrahamCampbell commented 9 years ago

Ping @taylorotwell. This was quite a long time ago, and to be fair, my PR did do some other stuff too, which was probably the underly reason.