Updates a setting value.

@param string      $name
@param string|null $value

@throws \CachetHQ\Cachet\Settings\WriteException

@return void
772371
public function set($name, $value)
    {
        $this->stale = true;

        try {
            if ($value === null) {
                $this->model->where('name', '=', $name)->delete();
            } else {
                $this->model->updateOrCreate(compact('name'), compact('value'));
            }
        } catch (Exception $e) {
            throw new WriteException($e);
        }
    }
836225
protected function addHeader(string $name, string $value): void
    {
        $this->headers->add($name, $value);
    }
1066419
public function set($name, $value)
    {
        $this->helper()->arr()->set($this->object, $name, $value);
    }
1247083
public function write($name, $value = null)
    {
        if (!$this->started()) {
            $this->start();
        }

        $write = $name;
        if (!is_array($name)) {
            $write = [$name => $value];
        }

        $data = isset($_SESSION) ? $_SESSION : [];
        foreach ($write as $key => $val) {
            $data = Hash::insert($data, $key, $val);
        }

        $this->_overwrite($_SESSION, $data);
    }
619259
public function setValue($name, $value)
    {
        // handle field
        if (static::fieldExists($name)) {
            $this->_setFieldValue($name, $value);
        }
        // undefined
        else {
            return false;
        }
    }
1267851
public function set($name, $value, $expire) {
        if (is_null($expire)) {
            $expire = $this->options['expire'];
        }
        $filename = $this->setCacheKey($name);

        $data = serialize($value);
        $data = "<?php\n//" . sprintf('%012d', $expire) . $data . "\n?>";
        file_put_contents($filename, $data);
    }
1042045
public function set($name, $value)
    {
        $name = $this->parseName($name);
        ObjectArrayHelper::set($this->data, $name, $value);
        $this->isChanged = true;
    }
342494
public function setAttribute(string $name, $value): void
	{
		Arr::set($this->attributes, $name, $value);
	}
1249097
public function set(string $name, $value)
    {
        $this->_data[$name] = $value;

        if(!is_object($value)) {
            $this->_changed[$name] = $value;
        }
    }
195418
public function setConfig($name, $value)
    {
        isset($this->config[$name]) && ($this->config[$name] = $value);
    }
560188
public function set($name, $value)
	{
		if ( $value === null ) {
			unset($this->settings[$name]);
		}
		else {
			$this->settings[$name] = $value;
		}

		$this->store();
	}
514814
public function set(string $name, string $value): void
    {
        $this->parameters[$name] = $value;
    }
1073
public function set($name, $value = null)
    {
        if (is_array($name)) {
            $this->parameters = array_replace($this->parameters, $name);
        } else {
            $this->parameters[trim(strtolower($name))] = is_string($value) ? trim($value) : $value;
        }
    }
924323
public function set($name, $value) : void
    {
        $_SESSION[$name] = $value;

        parent::set($name, $value);
    }
593475
public static function set($name,$value=null)
    {
        if(is_array($name)){
            self::$config=array_merge(self::$config,$name);
            return;
        }
        if(strstr($name,'.')===false){
            self::$config[$name]=$value;
        }else{
            list($l,$r)=explode('.',$name);
            self::$config[$l][$r]=$value;
        }
    }
961341
public function set(string $name, $value): void
    {
        $this->loader->setVariable($name, $value);
    }
108405
private function setMutated(string $name, $value)
    {
        $setter = $this->getMutator($name, self::MUTATOR_SETTER);

        if (!empty($setter)) {
            try {
                $this->fields[$name] = call_user_func($setter, $value);
            } catch (\Exception $e) {
                //Exceptional situation, we are choosing to keep original field value
            }
        } else {
            $this->fields[$name] = $value;
        }
    }