function Platform::isWindowsSubsystemForLinux
Return value
bool Whether the host machine is running on the Windows Subsystem for Linux (WSL)
1 call to Platform::isWindowsSubsystemForLinux()
- BinaryInstaller::installBinaries in vendor/
composer/ composer/ src/ Composer/ Installer/ BinaryInstaller.php
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ Platform.php, line 157
Class
- Platform
- Platform helper for uniform platform-specific tests.
Namespace
Composer\UtilCode
public static function isWindowsSubsystemForLinux() : bool {
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 (!(bool) ini_get('open_basedir') && is_readable('/proc/version') && false !== stripos((string) Silencer::call('file_get_contents', '/proc/version'), 'microsoft') && !self::isDocker()) {
return self::$isWindowsSubsystemForLinux = true;
}
}
return self::$isWindowsSubsystemForLinux;
}