Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BinaryInstaller: install full binaries on WSL when bin-compat=auto (#…
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,8 @@ class Platform | |
{ | ||
/** @var ?bool */ | ||
private static $isVirtualBoxGuest = null; | ||
/** @var ?bool */ | ||
private static $isWindowsSubsystemForLinux = null; | ||
|
||
/** | ||
* Parses tildes and environment variables in paths. | ||
|
@@ -67,6 +69,27 @@ public static function getUserDirectory() | |
throw new \RuntimeException('Could not determine user directory'); | ||
} | ||
|
||
/** | ||
* @return bool Whether the host machine is running on the Windows Subsystem for Linux (WSL) | ||
*/ | ||
public static function isWindowsSubsystemForLinux() | ||
{ | ||
if (null === self::$isWindowsSubsystemForLinux) { | ||
self::$isWindowsSubsystemForLinux = false; | ||
|
||
// while WSL will be hosted within windows, WSL itself cannot be windows based itself. | ||
if (self::isWindows()) { | ||
return self::$isWindowsSubsystemForLinux = false; | ||
} | ||
|
||
if (is_readable('/proc/version') && false !== stripos(file_get_contents('/proc/version'), 'microsoft')) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Seldaek
Member
|
||
return self::$isWindowsSubsystemForLinux = true; | ||
} | ||
} | ||
|
||
return self::$isWindowsSubsystemForLinux; | ||
} | ||
|
||
/** | ||
* @return bool Whether the host machine is running a Windows OS | ||
*/ | ||
|
This line is causing a not caught ErrorException on systems with enabled open_basedir.