Set a configuration value. To prevent misuse the configuration values can
not be changed after booting. Otherwise somebody will use it as a global
variable storage.

@param string|array $key
@param mixed        $value (optional)

@return self
320944
public function configure($key, $value=null)
    {
        if ($this->wasBooted()) {
            throw new UnsupportedUsageException('You can only set configuration before boot.');
        }

        if (!is_array($key)) {
            $this->config[$key] = $value;
            return $this;
        }

        foreach ($key as $configKey=>$value) {
            $this->configure($configKey, $value);
        }

        return $this;

    }
198522
public function setByKey($key, $value)
    {
        $storage = $this->getStorage();
        if ($value !== '' && $value !== null) {
            $storage[$key] = $value;
        } else {
            unset($storage[$key]);
        }
        $this->setStorage($storage);
    }
190820
public function set(string $key, $value): self
    {
        $this->options[$key] = $value;

        return $this;
    }
1323784
protected function setParameter($key, $value)
    {
        if (is_array($value) && isset($value['value'])) {
            $value = $value['value'];
        }

        $this->parameters->set($key, $value);

        return $this;
    }
1279569
public function set($name, $value)
    {
        $configuration = $this->configuration->getParameter('configuration');
        $configuration[$name] = $value;
        $this
            ->configuration
            ->setParameter(
                'configuration',
                $configuration
            );

        return $this;
    }
616885
public function setConfig($key = null, $value = null)
    {
        if (is_array($key)) {
            $this->config = $key;
        } else {
            $this->config[$key] = $value;
        }

        return $this;
    }
548230
public function set($key, $value)
    {
        $config = $this->data;
        if (!$key) {
            $config = array_merge($config, $value);
        }
        $key = is_array($key) ? $key : [$key];

        $data = &$config;
        while ($key) {
            $k = array_shift($key);
            $config[$k] = isset($config[$k]) ? $config[$k] : [];
            $config[$k] = $key
                ? $config[$k]
                : (is_array($value)
                    ? array_merge($config[$k], $value)
                    : $value);
            $config = &$config[$k];
        }
        $this->data = $data;
        return $this->save();
    }
498345
public function setOption($key, $value=null)
    {
        if (is_array($key)) {
            foreach ($key as $k => $v) {
                $this->setOption($k, $v);
            }
        } else {
            $this->options[$key] = $value;
            
            if ($this->storage && in_array($key, StorageInterface::AllowOptions)) {
                $this->storage->setOption($key, $value);
            }
        }
        return $this;
    }
906786
public function set($key, $value) {
		$this->loadIfNeeded();

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

		$this->saver->save($this->fileName, $this->array, $this->fileMap);
	}
564152
public function set($key, $value)
    {
        if ($config = $this->getConfigFor($key)) {
            if ($type = Arr::get($config, 'type')) {
                @settype($value, $type);
            }
            $this->setting->set($key, $value);
        }
    }
506162
public function set($key, $value) {
        $this->_data[$this->_namespace][$key] = $value;
        return $this;
    }
1358846
public function setOption($key, $value)
    {
        if (is_array($value)) {
            $this->options[$key] = array_merge($this->options[$key], $value);
        } else {
            $this->options[$key] = $value;
        }
        
        return $this;
    }
522903
function set($key, $value) {
        if(!$this->enabled) {
            return $this;
        }
        
        parent::set($key, $value);
        return $this;
    }
706900
public function set($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $configKey => $configValue) {
                $this->setSingleItem($configKey, $configValue);
            }
        } else {
            $this->setSingleItem($key, $value);
        }
    }
646878
public function set(string $key, $value): self
    {
        Arr::set($this->data, $key, $value, true);
        return $this;
    }
339901
public function setConfig($key, $value)
    {
        $keys = is_array($key) ? $key : [$key => $value];
        foreach ($keys as $key => $value) {
            Arr::set($this->configData, $key, $value);
        }
        return $this;
    }
973837
public function set($key, $value)
    {
        $keys = explode('.', $key);

        $data = $this->getAll();

        $resource = &$data;
        foreach ($keys as $key) {
            if (!isset($resource[$key]) || !is_array($resource[$key])) {
                $resource[$key] = [];
            }
            $resource = &$resource[$key];
        }
        $resource = $value;

        $this->setAll($data);

        return $this;
    }