Sets an environment variable, but does not overwrite existing variables

@param string $name The name of the environment variable to set
@param mixed $value The value
18686
public static function setVar(string $name, $value)
    {
        // Do not overwrite the variable if it already exists
        if (self::getVar($name) === null) {
            putenv("$name=$value");
            $_ENV[$name] = $value;
            $_SERVER[$name] = $value;
        }
    }
674680
public function set($name, $value)
    {
        if (!$this->isLocked()) {
            $_SESSION[$this->publicStorage]['store'][$this->_namespaceName][$name] = $value;
            return true;
        }
        return false;
    }
206837
public function setConfig(string $name, $value): void
    {
        if (array_key_exists($name, $this->configs)) {
            $this->configs[$name] = $value;
        }
    }
1032973
public boolean setEnvironmentVariable(String name, String value)
			throws SshException {
		ByteArrayWriter request = new ByteArrayWriter();
		try {
			request.writeString(name);
			request.writeString(value);

			return sendRequest("env", true, request.toByteArray());
		} catch (IOException ex) {
			throw new SshException(ex, SshException.INTERNAL_ERROR);
		} finally {
			try {
				request.close();
			} catch (IOException e) {
			}
		}
	}
175703
public function set(string $name, $value)
    {
        if (empty($name)) {
            return false;
        }

        if (isset($this->{$name})) {
            $this->{$name} = $value;
        } else {
            $this->properties[$name] = $value;
        }

        return true;
    }
1309085
public function setOption($name, $value) {
		$all = [];
		for ($i = 1; $i <= $this->connection_count; $i++) {
			$connection = $this->getConnection();
			$connection->setOption($name, $value);
			$all[] = $connection;
		}
		foreach ($all as $v) {
			$this->freeConnection($v);
		}
	}
594821
public function set_env($name, $value, $addtojs = true)
    {
        $this->env[$name] = $value;

        if ($addtojs || isset($this->js_env[$name])) {
            $this->js_env[$name] = $value;
        }
    }
176694
protected function setAttribute(string $name, $value) : void
    {
        // Convert values
        switch ($name) {
            case 'name':
                // no break here
            case 'value':
                $value = (string) $value;
                break;
            case 'prefixed':
                $value = (boolean) $value;
                break;
        }

        $this->$name = $value;
    }
331761
private function _setOption($name, $value)
    {
        if (!is_string($name) || !array_key_exists($name, $this->_options)) {
            Zend_Cache::throwException("Incorrect option name : $name");
        }
        if ($name == 'lifetime' && empty($value)) {
            $value = null;
        }
        $this->_options[$name] = $value;
    }
679153
public static function setConfigValue($name, $value)
    {
        $section = self::getConfig();
        $section[$name] = $value;
        Config::getInstance()->Tracker = $section;
    }
457383
protected function setRaw($name, $value, Environment $env, $valueUnreduced = null)
    {
        $env->store[$name] = $value;

        if ($valueUnreduced) {
            $env->storeUnreduced[$name] = $valueUnreduced;
        }
    }
370444
protected function setEnvironmentVariable($name, $value)
    {
        $name = strtoupper($name);
        $result = putenv("$name=$value");

        if ($result === false) {
            throw new Exception\RuntimeException(
                sprintf('Failed to set environment variable "%s"', $name)
            );
        }
    }
569457
public function set($name, $value = null)
    {
        $values = is_array($name) ? $name : [$name => $value];
        foreach ($values as $name => $value) {
            $this->itemSetting[$name] = $value;
        }

        unset($this->items[$name]);
    }
52998
public function addAttribute($name, $value) {
        $this->setVariable(self::ATTRIBUTES, $this->addValue($this->getVariable(self::ATTRIBUTES), $this->assembleAssignmentString($name, $value)));
    }
908124
protected function setExisting($name, $value, $env = null) {
        if (is_null($env)) $env = $this->getStoreEnv();

        if (isset($env->store[$name])) {
            $env->store[$name] = $value;
        } elseif (!is_null($env->parent)) {
            $this->setExisting($name, $value, $env->parent);
        } else {
            $this->env->store[$name] = $value;
        }
    }
804596
public static function set($key, $value)
    {
        putenv(vsprintf('%s=%s', [$key, $value]));
        $_ENV[$key] = $value;
        $_SERVER[$key] = $value;
    }
491937
public function set($name, $value)
    {
        if (is_array($value)) {
            $value = new ObjectConfig($value);
        }

        parent::set($name, $value);
    }