/home/techb158/ileadtechnology.com/vendor/composer/composer/src/Composer/Util
NameSizeModeActions
AuthHelper.php16950644editdlrm
Bitbucket.php85870644editdlrm
ComposerMirror.php17870644editdlrm
ConfigValidator.php86170644editdlrm
ErrorHandler.php28190644editdlrm
Filesystem.php223240644editdlrm
Git.php184220644editdlrm
GitHub.php60600644editdlrm
GitLab.php64010644editdlrm
Hg.php28820644editdlrm
IniHelper.php16320644editdlrm
NoProxyPattern.php106830644editdlrm
PackageSorter.php24600644editdlrm
Perforce.php175090644editdlrm
Platform.php26000644editdlrm
ProcessExecutor.php63580644editdlrm
RemoteFilesystem.php477310644editdlrm
Silencer.php21660644editdlrm
SpdxLicense.php5700644editdlrm
StreamContextFactory.php72950644editdlrm
Svn.php100440644editdlrm
TlsHelper.php66240644editdlrm
Url.php29040644editdlrm
Zip.php29580644editdlrm
Edit: /home/techb158/ileadtechnology.com/vendor/composer/composer/src/Composer/Util/Platform.php (2600B)
* Jordi Boggiano * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Util; /** * Platform helper for uniform platform-specific tests. * * @author Niels Keurentjes */ class Platform { /** * Parses tildes and environment variables in paths. * * @param string $path * @return string */ public static function expandPath($path) { if (preg_match('#^~[\\/]#', $path)) { return self::getUserDirectory() . substr($path, 1); } return preg_replace_callback('#^(\$|(?P%))(?P\w++)(?(percent)%)(?P.*)#', function ($matches) { // Treat HOME as an alias for USERPROFILE on Windows for legacy reasons if (Platform::isWindows() && $matches['var'] == 'HOME') { return (getenv('HOME') ?: getenv('USERPROFILE')) . $matches['path']; } return getenv($matches['var']) . $matches['path']; }, $path); } /** * @throws \RuntimeException If the user home could not reliably be determined * @return string The formal user home as detected from environment parameters */ public static function getUserDirectory() { if (false !== ($home = getenv('HOME'))) { return $home; } if (self::isWindows() && false !== ($home = getenv('USERPROFILE'))) { return $home; } if (function_exists('posix_getuid') && function_exists('posix_getpwuid')) { $info = posix_getpwuid(posix_getuid()); return $info['dir']; } throw new \RuntimeException('Could not determine user directory'); } /** * @return bool Whether the host machine is running a Windows OS */ public static function isWindows() { return defined('PHP_WINDOWS_VERSION_BUILD'); } /** * @param string $str * @return int return a guaranteed binary length of the string, regardless of silly mbstring configs */ public static function strlen($str) { static $useMbString = null; if (null === $useMbString) { $useMbString = function_exists('mb_strlen') && ini_get('mbstring.func_overload'); } if ($useMbString) { return mb_strlen($str, '8bit'); } return strlen($str); } }