Set configuration value(s)

@param string|array $path key or key-=value array
@param mixed        $val  value

@return void
427824
public function setCfg($path, $val = null)
    {
        if (\is_array($path)) {
            $cfgPassed = $path;
        } else {
            $cfgPassed = array();
            ArrayUtil::path($cfgPassed, $path, $val);
        }
        $this->cfg = ArrayUtil::mergeDeep($this->cfg, $cfgPassed);
    }
738563
public function set($path, $value)
    {
        PropertyAccessor::setByPath($this->values, $this->path($path), $value);
    }
176147
public static function set(array &$values, $path, $value)
    {
        if (is_array($path)) {
            // The path has already been separated into segments
            $segments = $path;
        } else {
            $path = (string) $path;

            // Remove starting delimiters and spaces
            $path = ltrim($path, sprintf('%s ', static::PATH_DELIMITER));
            // Remove ending delimiters, spaces, and wildcards
            $path = rtrim($path, sprintf('%s %s', static::PATH_DELIMITER, static::PATH_WILDCARD));
            // Split the segments by delimiter
            $segments = explode(static::PATH_DELIMITER, $path);
        }

        while (count($segments) > 1) {
            $key = array_shift($segments);

            /** @noinspection ReferenceMismatchInspection */
            if (!array_key_exists($key, $values) || !is_array($values[$key])) {
                $values[$key] = [];
            }

            $values =& $values[$key];
        }

        $values[array_shift($segments)] = $value;
    }
1357040
public function setConfigPath($path) 
    {
        if (file_exists($path)) {
            $this->configPath = $path;
        } else {
            throw new Exception(
                'Configuration file could not be found at ' .
                htmlspecialchars($path, ENT_QUOTES, 'UTF-8')
            );
        }
    }
187358
public final function set ($key, $val)
    {
        if (in_array($key, $this->getColumn())) {
            $this->record->{$key} = $val;
            return true;
        }

        return false;
    }
505382
public function setConfig($name, $val = null)
    {
        $setting = $this->settings;
        if (is_array($name)) {
            $setting = array_merge($setting, $name);
        } elseif ($val === null) {
            if (file_exists($name)) {
                $configs = include $name;
                $setting = array_merge($setting, $configs);
            } else {
                throw new Exception("不存在的配置文件:" . $name);
            }
        } else {
            $setting[$name] = $val;
        }
        $this->settings = $setting;
        return $this;
    }
1293486
public function set($path, $value)
    {
        $keys       = $this->explode($path);
        $parameters = &$this->parameters;

        while (count($keys) > 0) {
            if (count($keys) === 1) {
                if (!is_array($parameters)) {
                    $parameters = [];
                }
                $parameters[array_shift($keys)] = $value;
            } else {
                $key = array_shift($keys);
                if (!isset($parameters[$key])) {
                    $parameters[$key] = [];
                }
                $parameters = &$parameters[$key];
            }
        }
        return $this;
    }
966095
public static function setByPath(&$data, string $path, $value, string $separator = '.'): void
    {
        if (false === \strpos($path, $separator)) {
            $data[$path] = $value;
            return;
        }

        if (!$nodes = \array_filter(\explode($separator, $path))) {
            return;
        }

        $dataTmp = &$data;

        foreach ($nodes as $node) {
            if (\is_array($dataTmp)) {
                if (empty($dataTmp[$node])) {
                    $dataTmp[$node] = [];
                }

                $dataTmp = &$dataTmp[$node];
            } else {
                // If a node is value but path is not go to the end, we replace this value as a new store.
                // Then next node can insert new value to this store.
                $dataTmp = [];
            }
        }

        // Now, path go to the end, means we get latest node, set value to this node.
        $dataTmp = $value;
    }
1041844
public function setPath($path)
    {
        if (!file_exists($path))
        {
            mkdir($path, 0777, true);
        }

        $this->path = $path;
    }
1268972
public function setValue($val)
    {
        $this->con->executeStep(
            sprintf('_sahi._setValue(%s, %s)', $this->getAccessor(), json_encode($val))
        );
    }
570884
public function setParam($name, $val)
    {
        if ( ! is_string($name) || ! is_string($val)) {
            return;
        }
        $this->data[$name] = $val;

        return $this;
    }
394017
public function setUrlParams($key = 'path', $val = '')
    {
        if (is_array($key)) {
            self::$urlParams = array_merge(self::$urlParams, $key);
        } else {
            self::$urlParams[$key] = $val;
        }
    }
322481
public void setVal(String val) {

        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(val)) {
            m_value = val.trim();
        } else {
            m_value = val;
        }
    }
738061
public function set($path, $value)
    {
        if (!empty($path)) {
            $at   = &$this->getValues();
            $keys = $this->explode($path);

            while (count($keys) > 0) {
                if (count($keys) === 1) {
                    if (is_array($at)) {
                        $at[array_shift($keys)] = $value;
                    } else {
                        throw new \RuntimeException("Can not set value at this path ($path) because is not array.");
                    }
                } else {
                    $key = array_shift($keys);
                    if (!isset($at[$key])) {
                        $at[$key] = [];
                    }
                    $at = &$at[$key];
                }
            }
        } else {
            $this->values = $value;
        }
    }
118928
def set_val(self, direct, section, val):
        
        if val is not None:
            self.config.set(direct, section, val)
            self.update()
437169
public function set($key, $val)
    {
        $this->_data = Hash::merge([$key => $val], $this->_data);
        return $this;
    }
1199135
public function setConfig($config = array(), $val = UNDEFINED)
    {
        if ($val !== UNDEFINED) {
            return $this->setConfig(array($config => $val));
        }
        $this->config = array_merge($this->config ?: array(), $config ?: array());
    }