Skip to content

getenv non covered system method #543

Description

@cenxun

This error occurred when I cloned the develop branch and configured the env file
getenv_error

It looks as if genenv has not rewritten the system method

BASEPATH/Config\DotEnv.php at line 124, setVariable method

	/**
	 * Sets the variable into the environment. Will parse the string
	 * first to look for {name}={value} pattern, ensure that nested
	 * variables are handled, and strip it of single and double quotes.
	 *
	 * @param string $name
	 * @param string $value
	 */
	protected function setVariable(string $name, string $value = '')
	{
		list($name, $value) = $this->normaliseVariable($name, $value);

		if (! getenv($name, true)) putenv("$name=$value");
		if (empty($_ENV[$name])) $_ENV[$name] = $value;
		if (empty($_SERVER[$name])) $_SERVER[$name] = $value;
	}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions