function Platform::getEnv
getenv() equivalent but reads from the runtime global variables first
Parameters
non-empty-string $name:
Return value
string|false
40 calls to Platform::getEnv()
- Application::doRun in vendor/
composer/ composer/ src/ Composer/ Console/ Application.php - Runs the current application.
- Application::getDefaultCommands in vendor/
composer/ composer/ src/ Composer/ Console/ Application.php - Initializes all the composer commands.
- BaseCommand::initialize in vendor/
composer/ composer/ src/ Composer/ Command/ BaseCommand.php - @inheritDoc
- Cache::gcIsNecessary in vendor/
composer/ composer/ src/ Composer/ Cache.php - Config::getComposerEnv in vendor/
composer/ composer/ src/ Composer/ Config.php - Reads the value of a Composer environment variable
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ Platform.php, line 77
Class
- Platform
- Platform helper for uniform platform-specific tests.
Namespace
Composer\UtilCode
public static function getEnv(string $name) {
if (array_key_exists($name, $_SERVER)) {
return (string) $_SERVER[$name];
}
if (array_key_exists($name, $_ENV)) {
return (string) $_ENV[$name];
}
return getenv($name);
}