Parse all environment variables

@return mixed[]
484637
public static function parseAllEnvironmentParameters(): array
	{
		$parameters = [];
		foreach ($_SERVER as $key => $value) {
			// Ensure value
			$value = getenv($key);
			if ($value !== false) {
				$parameters[$key] = $value;
			}
		}

		return $parameters;
	}
237801
public function getEnvironmentMessages()
    {
        $messages = array();
        foreach ($this->getEnvironments() as $environment) {
            $style = 'general';
            if (false == $this->vagrentExists($environment)) {
                $style = 'warning';
            }
            $messages[$environment] = $style;
        }
        return $messages;
    }
1317649
public static function getVariables()
    {
        // Suppress return by-ref
        $vars = [ 'env' => static::$env ];
        // needs to use a for loop, using `array_merge([], $GLOBALS);` left reference traces somehow
        foreach ($GLOBALS as $varName => $varValue) {
            $vars[$varName] = $varValue;
        }

        return $vars;
    }
196944
public function toArray()
    {
        return [
            'platform'        => $this->platform,
            'environment'     => $this->environment,
            'version'         => $this->version,
            'majorVersion'    => $this->majorVersion,
            'minorVersion'    => $this->minorVersion,
            'patchVersion'    => $this->patchVersion,
            'deviceOsVersion' => $this->deviceOsVersion,
            'device'          => $this->device,
        ];
    }
1308475
private function getServerArguments() {
        $args = $_SERVER['argv'];
        array_shift($args);

        $args = $this->parseArgs($args);

        return $args;
    }
251433
public function getEnvironmentsForCheckout()
    {
        $project = $this->getWelcomeCommand()->getCurrentProject();
        if (!$project) {
            return [];
        }
        try {
            $currentEnvironment = $this->getWelcomeCommand()->getCurrentEnvironment($project, false);
        } catch (\Exception $e) {
            $currentEnvironment = false;
        }
        $environments = $this->api->getEnvironments($project, false, false);
        if ($currentEnvironment) {
            $environments = array_filter(
                $environments,
                function ($environment) use ($currentEnvironment) {
                    return $environment->id !== $currentEnvironment->id;
                }
            );
        }

        return array_keys($environments);
    }
787542
private function loadFiles(): array
    {
        $items = [];
        if (!is_dir($this->path)) {
            return $items;
        }

        $entries = Finder::create()->files()->name('*.php')->in($this->path);

        // Load files.
        foreach ($entries as $entry) {
            $basename = call_user_func([$entry, 'getBasename']);

            if ($this->isEnvironmentFilename($basename)) {
                // Do not process this file. It will be handled later.
                continue;
            }

            $pathRelative = call_user_func([$entry, 'getRelativePath']);
            $configKey = rtrim($basename, '.php');

            // Load main config-file.
            $this->loadFile($items, $this->path, $pathRelative, $configKey);

            // Load environment config-file.
            $this->loadFile($items, $this->path, $pathRelative, $configKey, $this->environment);
        }

        return $items;
    }
757332
public function getSpecialVariables()
    {
        $vars = [
            '_' => $this->returnValue,
        ];

        if (isset($this->lastException)) {
            $vars['_e'] = $this->lastException;
        }

        if (isset($this->lastStdout)) {
            $vars['__out'] = $this->lastStdout;
        }

        if (isset($this->boundObject)) {
            $vars['this'] = $this->boundObject;
        }

        return \array_merge($vars, $this->commandScopeVariables);
    }
1350026
public function getVariables()
    {
        $ret = [];
        foreach ($this->branchVariables as $branchId => $vars) {
            foreach ($vars as $var) {
                $ret[$var->getName()] = $var;
            }
        }

        return $ret;
    }
486273
public function getAll()
    {
        if ($_ENV) return $_ENV;
        $info = $this->getPhpInfo();
        $_ENV = $this->parser->parse($info);
        return $_ENV;
    }
1342003
public function load($environment = null)
    {
        if ($environment == 'production') $environment = null;

        if (! $this->files->exists($path = $this->getFile($environment))) {
            return array();
        } else {
            return $this->files->getRequire($path);
        }
    }
1337738
protected function getEnvParameters() {
    $parameters = array();

    // add config dir as a parameter
    $parameters['kernel.config_dir'] = $this->configDir;

    // add server variables
    foreach ($_SERVER as $key => $value) {
      if (0 === strpos($key, 'DRUPAL__')) {
        $parameters[strtolower(str_replace('__', '.', substr($key, 8)))] = $value;
      }
    }

    // add constants
    $constants = get_defined_constants(true);
    foreach ($constants['user'] as $key => $value) {
      if (0 === strpos($key, strtoupper($this->name) . '_')) {
        $parameters[strtolower(str_replace('_', '.', $key))] = $value;
      }
    }

    return $parameters;
  }
364235
protected function _gatherConfigVars() {
        $source = $this->_stdin ?
            $this->_parseStdin($this->_stdin) :
            Zend_Registry::get('config')->toArray();
        $cdnConfig = f\prop('cdn', $source);
        $s3Config = f\prop('s3', $cdnConfig);
        return array(
            'apikey'          => f\prop('apikey', $s3Config),
            'secret'          => f\prop('secret', $s3Config),
            'bucket'          => f\prop('bucket', $s3Config),
            'region'          => f\prop('region', $s3Config),
            'readonly'        => f\prop('readonly', $cdnConfig),
            'gzip'            => f\prop('gzip', $cdnConfig),
            'gzip_exceptions' => f\prop('gzip_exceptions', $cdnConfig)
        );
    }
740479
def get_environ_vars(self, prefix='VIRTUALENV_'):
        
        for key, val in os.environ.items():
            if key.startswith(prefix):
                yield (key.replace(prefix, '').lower(), val)
1184150
private function getEnvironmentVariables()
    {
        // Initialize from globals, allow override of special keys via putenv calls.
        $variables = $this->inheritEnvironment
            ? array_replace($_ENV, $_SERVER, $this->environment)
            : $this->environment;

        foreach (array_keys($variables) as $name) {
            if (false !== ($value = getenv($name))) {
                $variables[$name] = $value;
            }
        }

        return $variables;
    }
895533
private function getVarRegexes() : array
    {
        $variableRegexes = [];

        foreach ($this->groupOptionsStack as $groupOptions) {
            if (isset($groupOptions['vars'])) {
                $variableRegexes = array_merge($variableRegexes, $groupOptions['vars']);
            }
        }

        return $variableRegexes;
    }
844017
protected function getConfigPaths(): array
    {
        $paths = ConfigPaths::all();

        if (count($paths) < 1) {
            WP_CLI::error_multi_line([
                'No config file found.',
                "Perhaps '" . ConfigPaths::HOOK . "' not filtering properly?",
            ]);

            WP_CLI::error('Abort!');
        }

        return $paths;
    }