Set a Configuration $key to $value

The $key is in DOT format.

Example: set('application.code','theValue');

@param      string  $key    Key to update/set. Dot notaition
@param      mixed   $value

@return     self
186944
public function set(string $key, $value)
  {
    $keys = \explode('.',$key);
    $arr = &$this->confValues;
    $arrParent = null;

    # Walk the structure
    foreach ($keys as $key) {
      $arrParent = &$arr;
      $lastKey = $key;
      if (!isset($arr[$key])) {
        $arr[$key]=[];
      }
      $arr = &$arr[$key];
    }

    if (\is_null($value)) {
      unset($arrParent[$lastKey]); // delete the key
    } else {
      $arr = $value; // set the value in the original confArray
    }

    return $this;
  }
1112767
public function setHost($key, $value)
    {
        $hostname = $this->getHostname();

        if ($key !== 'name') {
            $this->configs['hosts'][$hostname][$key] = $value;
            return $this;
        }

        if ($hostname === $value) {
            return $this;
        }

        $this->configs['hosts'][$value] = $this->configs['hosts'][$hostname];
        unset($this->configs['hosts'][$hostname]);
        $this->setHost('deploy_path', "/var/www/$value");
        
        return $this;
    }
230843
public function add($key, $value)
    {
        $array = array_get($this->configs, $key);

        if (is_array($array)) {
            $array[] = $value;
            array_set($this->configs, $key, $array);
        }


        return $this;
    }
329896
public function setOption($key, $value)
    {
        $this->_validateOption($key);

        $this->_options[$key] = $value;

        return $this;
    }
323813
public function set($key, $value)
    {

        if (empty($key)) return false;

        $this->engineVarList->$key = $value;

        return $this;
    }
42711
public function setConfigurationValue($key, $value)
    {
        $completeConfiguration = $this->getConfiguration();
        $configuration = &$completeConfiguration;

        $pathParts = explode(self::DELIMITER, $key);
        foreach ($pathParts as $pathPart) {

            // If the current configuration is not an array,
            // but the client want to set a value, just overwrite the current value
            if (is_array($configuration) === false) {
                $configuration = [];
            }
            $configuration = &$configuration[ucfirst($pathPart)];
        }

        $configuration = $value;
        $this->setConfiguration($completeConfiguration);
    }
1373323
public function set($key, $value) {
        if (!is_string($key)) throw new IllegalTypeException('Illegal type of parameter $key: '.gettype($key));
        $this->setProperty($key, $value);
        return $this;
    }
350249
public function set($key, $value)
    {
        $this->checkWriteAccess();
        $this->_settings[$key] = $value;
        return $this;
    }
171127
public function set(string $key, $value)
    {
        return Arr::set($this->meta, $key, $value);
    }
655681
protected function setState($key, $value)
    {
        $this->getStateStorage()->set($this->getStateKeyPrefix() . $key, $value);
        return $this;
    }
961836
public function set($key, $value)
    {
        if (is_null($value)) {
            $value = 'NULL';
        } else if (is_bool($value)) {
            $value = $value ? 'TRUE' : 'FALSE';
        }
        
        $this->set[$key] = $value;
        
        return $this;
    }
611249
public function setKey(string $value) : Setting
    {

        if ($this->data['key'] !== $value) {
            $this->data['key'] = $value;
            $this->setModified('key');
        }

        return $this;
    }
559866
protected function setKey($key, $value)
    {
        $key = strtolower((string)$key);
        $this->keys[$key] = (string)$value;
    }
1252193
public function set($key, $value = null)
    {
        if ($value === null) {
            $this->defaultValues = $key + $this->defaultValues;
        } else {
            $this->defaultValues[$key] = $value;
        }

        return $this;
    }
920234
public function set($key, $value)
    {
        if ($key === null && is_object($value)) {
            $key = spl_object_hash($value);
        }

        $this->data[$key] = $value;

        return $this;
    }
678312
public function set($key, $value)
    {
        $this->constants[$key] = $value;

        $same = $key === 'APPPATH';

        $path = $this->constants[$key] . '/views/';

        $same && $this->constants['VIEWPATH'] = $path;

        return $this;
    }
121855
public function set($key, $value) {
        $key = $this->getAbsoluteConfigKey($key);

        array_set($this->config, $key, $value);

        return $this;
    }