Overwrites an Environment Configuration Option

@param string $key
@param mixed $value
@return Runtime
435968
public function setEnvOption($key, $value)
    {
        if (array_key_exists('environments', $this->configuration) && is_array($this->configuration['environments'])) {
            if (array_key_exists($this->environment, $this->configuration['environments'])) {
                $this->configuration['environments'][$this->environment][$key] = $value;
            }
        }

        return $this;
    }
247258
public function addOption($key, $value)
    {
        if (!$this->isOptionKeyValid($key)) {
            throw new \RuntimeException('Invalid socket option '.$key.'.');
        }

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

        return $this;
    }
1023598
public function setOption($key, $value)
    {
        //set value
        if (in_array($key, $this->defaultOptions) && $key !== CURLOPT_WRITEFUNCTION) {
            $this->setDefaultOption($key, $value);
        } else {
            $this->options[$key] = $value;
        }

        //return self
        return $this;
    }
52878
static public function set($key, $value) {
        $config = &self::$_config;
        
        Utils::arraySet($config, $key, $value);
    }
350249
public function set($key, $value)
    {
        $this->checkWriteAccess();
        $this->_settings[$key] = $value;
        return $this;
    }
188631
public function setConfig($key,$value = ''){
		if(is_array($key)){
			$this->_config = array_merge($this->_config,$key);
		}
		else{
			$this->_config[$key] = $value;
		}
		$this->updateConfig();
		
		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;
    }
1316827
public function set($key, $value)
    {
        $this->data[$key] = $value;
        $this->version++;
        
        return $this;
    }
1155307
protected function addValueToEnv($key, $value)
    {
        $env_path = base_path('.env');
        $sed_command = "/bin/sed -i '/^$key=/d' " . $env_path;
        passthru($sed_command);
        File::append($env_path, "\n$key=$value\n");
    }
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;
  }
883235
public function option($key, String $value = NULL)
    {
        if( is_array($key) )
        {
            $this->settings['option'] = $key;
        }
        else
        {
            $this->settings['option'][$key] = $value;
        }

        return $this;
    }
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;

    }
1310408
public function setConfig($key, $value = null)
    {
        $configurator = $this->getConfigurator();
        if(!is_scalar($key)){
            $configuratorClass = get_class($configurator);
            $configurator->merge(new $configuratorClass($key, true));
        }else{
            $configurator[$key] = $value;
        }

        return $this;
    }
137760
public function set(string $key, string $value): ConfigInterface
    {
        $this->settings[$key] = $value;

        return $this;
    }
917803
private function setEnv($key, $value)
    {
        $array = $this->getEnv();
        $index = array_search($key, array_column($array, 'key'));
        if ($index !== false) {
            $array[$index]['value'] = $value; // 更新
        } else {
            array_push($array, ['key' => $key, 'value' => $value]); // 新增
        }
        return $this->saveEnv($array);
    }
950525
public function config($key = null, $value = null, $override = false)
    {
        if (is_array($key) && is_bool($value)) {
            $override = $value;
        }

        return Util::operateArray($this->config, $key, $value, null, null, $override);
    }
303555
protected function saveConfig($key, $value)
    {
        $content = $this->readConfig();
     
        if (!$content) {
            $content = [];
        }
        
        $content[$key] = $value;
        
        $save = FileHelper::writeFile($this->configFile, Json::encode($content));
        
        if (!$save) {
            return $this->outputError("Unable to find config file " . $this->configFile. ". Please create and provide Permissions.");
        }
        
        return $value;
    }