@param string $var
@param string $value

@return \chillerlan\DotEnv\DotEnv
501884
public function set(string $var, string $value = null):DotEnv{
		$var   = strtoupper($var);
		$value = $this->parse($value);

		if($this->global === true){
			putenv($var.'='.$value);

			// fill $_ENV explicitly, assuming variables_order="GPCS" (production)
			$_ENV[$var] = $value;

			// @codeCoverageIgnoreStart
			if(function_exists('apache_setenv')){
				/** @noinspection PhpComposerExtensionStubsInspection */
				apache_setenv($var, $value);
			}
			// @codeCoverageIgnoreEnd
		}

		// a backup
		$this->_ENV[$var] = $value;

		return $this;
	}
1016607
public static function clean_vars($value){
        if(is_array($value)){
            foreach($value as $key => $val) {
                $value[$key] = self::clean_vars($val);
            }
        }
        else{
            $value= self::filter_simple_xss($value);
        }
        return $value;
    }
518074
public function addVarAttr($name, $value)
    {
        if (!in_array($name, $this->varAttr)) {
            $this->varAttr[$name] = $value;
        }
        return $this;
    }
392525
private function phpEncodeValue($value)
    {
        if (is_array($value)) {
            return $this->phpEncodeArray($value);
        }

        if (is_string($value)) {
            return json_encode($value);
        }

        return var_export($value, true);
    }
286901
public function theVariableIsSetTo($variable, $value)
    {
        ProcessBuilder::create()
            ->setPrefix($this->drushBin)
            ->add('variable-set')
            ->add($variable)
            ->add($value)
            ->add('--exact')
            ->add('--yes')
            ->setWorkingDirectory($this->drupalDir)
            ->getProcess()
            ->mustRun();
    }
976275
public function setVar($name, $value)
	{
		$this->vars[$name] = $value;

		$this->query = null;

		return $this;
	}
1126534
public function setGreen($value)
    {
        $this->assertChannelValue($value, self::CHANNEL_GREEN);
        $this->green = $value;

        return $this;
    }
1244179
public function setEnvironmentVariable($name, $value = null)
    {
        list($name, $value) = $this->normaliseEnvironmentVariable($name, $value);

        // Don't overwrite existing environment variables if we're immutable
        // Ruby's dotenv does this with `ENV[key] ||= value`.
        if ($this->immutable === true && !is_null($this->getEnvironmentVariable($name))) {
            return;
        }

        $_ENV[$name] = $value;
        $_SERVER[$name] = $value;
        putenv("$name=$value");
    }
887309
public function with($vars, $value = null)
    {
        if (is_string($vars)) {
            $vars = [$vars => $value];
        }

        presenter()->merge($vars);

        return $this;
    }
747901
public static function set($var, $value) {
        //  	var_dump($var." ".$value);
        Session::init(true);
        if (!Session::check_checksum()) return false;
        $_SESSION[$var] = $value;
        $_SESSION[__SESSION_checksum_var] = Session::make_checksum();
        return $value;
    }
1063210
public function withBindVariableValue($key, $value)
    {
        $this->valueMap[$key] = Pql::createValue($value);

        return $this;
    }
1241788
public function withValue(string $value): self
    {
        $cookie = clone $this;
        $cookie->value = $value;

        return $cookie;
    }
220768
public function set($name, $value)
  {
    if (is_null($value)) {
      unset($this->vars[$name]);
    } else {
      $this->vars[$name] = $value;
    }

    return $this;
  }
409394
protected function getenv($varname): ?string
    {
        $value = getenv($varname, true);

        if ($value === false) {
            $value = getenv($varname);
        }

        return $value !== false ? $value : null;
    }
10245
private function with($variable, $value)
    {
        if ($value === $this->$variable) {
            return $this;
        }

        $uri = clone $this;
        $uri->$variable = $value;

        return $uri;
    }
1004116
public function env($key, $value = null)
    {
        if ($value !== null) {
            $_ENV[$key] = $value;
            putenv($key . '=' . $value);
        }

        if (isset($_ENV[$key])) {
            return $_ENV[$key];
        }
        return false === getenv($key) ? null : getenv($key);
    }
172638
static function val($name, $value = null) 
    {
        if ($value === null)
            return static::$vars[$name];
        static::$vars[$name] = $value;
    }