Method to add capability of override the getenv function of PHP
for example to get env data in a sandbox
@param string $name
@return mixed
338608
public function getEnv($name)
    {
        if (array_key_exists($name, $this->mockedData)) {
            return $this->mockedData[$name];
        }

        return getenv($name);
    }
1142989
public function getEnv($name = null, $defaultValue = null) 
    {
        if ($name === null) {
            return $_ENV;
        }
        return (isset($_ENV[$name])) ? $_ENV[$name] : $defaultValue;
    }
262704
public static function get(string $name)
  {
    if (isset($_SESSION['application']['with'][$name])) {
      $_SESSION['application']['flash']['used'] = true;
      return $_SESSION['application']['with'][$name];
    }

    return Variable::has($name) ? Variable::$data[$name] : null;
  }
1833
final public function &__get($name)
    {
        $value = $this->data[$name];

        //Apply accessor
        $this->applyModifier($name, $value, 'get');

        return $value;
    }
905822
public static function get($name)
    {
        if (self::$options & self::USE_ENV_ARRAY) {
            $value = isset($_ENV[$name]) ? $_ENV[$name] : false;
        } elseif (self::$options & self::LOCAL_FIRST) {
            $value = getenv($name, true);

            if ($value === false) {
                $value = getenv($name);
            }
        } else {
            $value = getenv($name);
        }

        if ($value === false) {
            return self::$default;
        }

        return self::convert($value);
    }
1250521
protected function retrieveClass($name)
    {
        if (!$this->enumExists($name)) {
            $this->enums[$name] = $this->buildClass($name);
        }

        return $this->enums[$name];
    }
945636
public function getHeader($name, $default = null)
    {
        if (empty($name)) {
            return $default;
        }

        $temp = 'HTTP_' . strtoupper(str_replace('-', '_', $name));
        if (isset($this->env[$temp])) {
            return $this->env[$temp];
        }

        if (function_exists('apache_request_headers')) {
            // @codeCoverageIgnoreStart
            $method = 'apache_request_headers';
            $headers = $method();
            if (isset($headers[$name])) {
                return $headers[$name];
            }
            $header = strtolower($name);
            foreach ($headers as $key => $value) {
                if (strtolower($key) == $name) {
                    return $value;
                }
            }
        }
        // @codeCoverageIgnoreEnd

        return $default;
    }
768861
public function &get($name)
    {
        if (!isset($this->mergedSettings[$name])) {
            $this->mergedSettings[$name] = array();
        }

        $result =& $this->mergedSettings[$name];
        return $result;
    }
262134
public function get($name = null) {
		if ($name === null) {
			$result = [];
			$this->_configurations = array_filter($this->_configurations);

			foreach ($this->_configurations as $key => $value) {
				$result[$key] = $this->get($key);
			}
			return $result;
		}

		$settings = &$this->_configurations;

		if (!isset($settings[$name])) {
			return null;
		}

		if (isset($settings[$name][0])) {
			return $settings[$name][0];
		}
		$env = Environment::get();

		$config = isset($settings[$name][$env]) ? $settings[$name][$env] : $settings[$name];

		$method = is_callable($this->initConfig) ? $this->initConfig : null;
		$settings[$name][0] = $method ? $method($name, $config) : $config;
		return $settings[$name][0];
	}
653802
public function getVariable($name)
    {
        $encodedValue = $this->getEnvironmentVariable($name);

        if ($encodedValue === null) {
            return null;
        }

        return $this->decode($encodedValue);
    }
142540
public static String getEnvVariable( String name )
        throws EnvironmentException
    {
        if( isUnix() )
        {
            Properties properties = getUnixShellVariables();
            return properties.getProperty( name );
        }
        else if( isWindows() )
        {
            Properties properties = getWindowsShellVariables();
            return properties.getProperty( name );
        }

        String osName = System.getProperty( "os.name" );
        throw new EnvironmentException( name, "Non-supported operating system: " + osName );
    }
14183
public static function getVar(string $name, $defaultValue = null)
    {
        $value = getenv($name);
        return $value !== false ? $value : $defaultValue;
    }
1138597
protected function getEnvName($name)
    {
        if (is_array($name)) {
            return array_map(array($this, __METHOD__), $name);
        } else {
            $prefix = $this->envVariablePrefix;
            if (!empty($prefix)) {
                $prefix .= '_';
            }

            return strtoupper($prefix . $name);
        }
    }
22119
public static function get($name)
    {
        $class = get_called_class();
    
        if (!isset(self::$instance[$class])) {
            self::$instance[$class] = new static();
        }
        
        return self::$instance[$class]->getExtensions()->get($name);
    }
1163380
public static function getResource(string $name)
    {
        $resource = static::getInstance($name)->getResource();

        if(RequestContext::exsits() && $resource)
        {
            static::pushResourceToRequestContext($resource);
        }

        return $resource;
    }
884908
private static function environmentVariableExists($name)
    {
        switch (true) {
            case array_key_exists($name, $_ENV):
                return true;
            case array_key_exists($name, $_SERVER):
                return true;
            default:
                $value = getenv($name);
                return $value !== false;
        }
    }
355882
protected function defaultValue(/*# string */ &$name)
    {
        $default = null;
        if (false !== strpos($name, ':-')) {
            list($name, $default) = explode(':-', $name, 2);
        } elseif (false !== strpos($name, ':=')) {
            list($name, $default) = explode(':=', $name, 2);
            if (false === getenv($name)) {
                $this->setEnv($name, $default, false);
            }
        }
        return $default;
    }