Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Platform.php

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

... See full list

File

vendor/composer/composer/src/Composer/Util/Platform.php, line 77

Class

Platform
Platform helper for uniform platform-specific tests.

Namespace

Composer\Util

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal