1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 07:58:58 +01:00

Windows support

This commit is contained in:
Daniil Gentili 2020-09-24 11:58:00 +02:00
parent bc13e61526
commit 7a550311ac

View File

@ -38,8 +38,14 @@ final class ProcessRunner extends RunnerAbstract
$runner = self::getScriptPath();
if (\strtolower(\substr(PHP_OS, 0, 3)) === 'win') {
$binary = \str_replace("Program Files", "PROGRA~1", $binary);
// Pray there are no spaces in the name, escapeshellarg would help but windows doesn't want quotes in the program name
} else {
$binary = \escapeshellarg($binary);
}
$command = \implode(" ", [
\escapeshellarg($binary),
$binary,
self::formatOptions($options),
$runner,
'madeline-ipc',