create or update config data

@param string
@param mix
@return void
557827
static function write($key,$value){
	
		$segments = self::engineName($key);
		$file = [implode($segments->file,'.')];
		
		// set key data
		$keys = array_merge($file,$segments->keys);
		
		// update config data
		self::$data = array_replace_recursive(
			self::$data ,
			self::_makeDimensional($keys,$value)
		);
	}
957133
public function setup($config)
    {
        // create fixes, initialize fixesForLevel
        $fixes = $this->makeFixes();
        $this->makeFixesForLevel($fixes);

        // figure out which fixes to use
        $level = $config->get('HTML.TidyLevel');
        $fixes_lookup = $this->getFixesForLevel($level);

        // get custom fix declarations: these need namespace processing
        $add_fixes = $config->get('HTML.TidyAdd');
        $remove_fixes = $config->get('HTML.TidyRemove');

        foreach ($fixes as $name => $fix) {
            // needs to be refactored a little to implement globbing
            if (isset($remove_fixes[$name]) ||
                (!isset($add_fixes[$name]) && !isset($fixes_lookup[$name]))) {
                unset($fixes[$name]);
            }
        }

        // populate this module with necessary fixes
        $this->populate($fixes);
    }
1067895
function merge(self $config): void {
    foreach ($config as $key => $value) $this[$key] = $value;
  }
1010722
function mixin(name, mix, g) {
      // Unnamed global
      if (isObject$1(name)) {
        mixin(("__" + (mixins_id++) + "__"), name, true);
        return
      }

      var store = g ? globals : mixins;

      // Getter
      if (!mix) {
        if (isUndefined(store[name]))
          { throw new Error(("Unregistered mixin: " + name)) }

        return store[name]
      }

      // Setter
      store[name] = isFunction$1(mix) ?
        extend(mix.prototype, store[name] || {}) && mix :
        extend(store[name] || {}, mix);
    }
210745
private function buildQueryParamValue($mix_value)
    {
        $obj_val = new \stdClass();
        $str_type = gettype($mix_value);
        switch($str_type) {
            case 'boolean':
                $obj_val->booleanValue = $mix_value;
                break;

            case 'integer':
                $obj_val->integerValue = $mix_value;
                break;

            case 'double':
                $obj_val->doubleValue = $mix_value;
                break;

            case 'string':
                $obj_val->stringValue = $mix_value;
                break;

            case 'array':
                throw new \InvalidArgumentException('Unexpected array parameter');

            case 'object':
                $this->configureObjectValueParamForQuery($obj_val, $mix_value);
                break;

            case 'NULL':
                $obj_val->nullValue = null;
                break;

            case 'resource':
            case 'unknown type':
            default:
                throw new \InvalidArgumentException('Unsupported parameter type: ' . $str_type);
        }
        return $obj_val;
    }
225343
protected static function mergeConfig($newData, &$baseConfig)
    {
        if (is_array($newData)) {
            foreach ($newData as $key => $value) {
                if (isset($baseConfig[$key])) {
                    self::mergeConfig($value, $baseConfig[$key]);
                } else {
                    $baseConfig[$key] = $value;
                }
            }
        } else {
            $baseConfig = $newData;
        }
    }
809585
public function setValue($mixValue){
		if(!$this->isValid($mixValue)){
			if($this->hasOption('class')){
				$strClass = $this->options()->class;

				try {
					$mixValue = new $strClass($mixValue);
				}catch (\Exception $e){
					throw new TypeException($mixValue, get_class($this));
				}
			}
		}

		parent::setValue($mixValue);
	}
1342346
public function update_config(&$data) {
        if (!empty($data->criteria_self)) {
            $this->course = $data->id;
            $this->insert();
        }
    }
1247715
public function writeConfiguration()
    {
        $configFile= APP_PATH.'config/database.php';
        $config    = $this->getPostConfiguration();

        $configStr = <<<CONFIG
<?php

\$config['database'] = array(
    'default'       => '{$config['driver']}',

    'connections'   => array(
        '{$config['driver']}'     => array(
            'driver'    => '{$config['driver']}',
            'host'      => isset(\$_SERVER['DB1_HOST']) ? \$_SERVER['DB1_HOST'] : '{$config['host']}',
            'database'  => isset(\$_SERVER['DB1_NAME']) ? \$_SERVER['DB1_NAME'] : '{$config['database']}',
            'username'  => isset(\$_SERVER['DB1_USER']) ? \$_SERVER['DB1_USER'] : '{$config['username']}',
            'password'  => isset(\$_SERVER['DB1_PASS']) ? \$_SERVER['DB1_PASS'] : '{$config['password']}',
            'charset'   => '{$config['charset']}',
            'collation' => '{$config['collation']}',
            'prefix'    => '{$config['prefix']}'
        )
    )
);
CONFIG;

        file_put_contents($configFile, $configStr);

        $this->makeConnection($config);
        $this->migrate();
        $this->seed();

        Response::redirect($this->data['baseUrl'].'install.php/finish');
    }
40674
@Override
    public final void initialize(MixinImplementor mixinImplementor) {
        checkState(this.mixinImplementor == null, "Re-entry is not allowed.");

        this.mixinImplementor = checkNotNull(mixinImplementor, "mixinImplementor");
        try {
          initialize();
        }
        finally {
            this.mixinImplementor = null;
        }
    }
1170301
public function set($strKey, $mixValue){
		if($this->has($strKey)){
			$this->getValue()[$strKey] = $mixValue;
			$this->updateKeys();
		}else{
			throw new \Exception();
		}
	}
886866
public function update_config(&$data) {
        if (!empty($data->criteria_duration)) {
            $this->course = $data->id;
            $this->enrolperiod = $data->criteria_duration_days;
            $this->insert();
        }
    }
1032087
function(data) {
		var self = this;

		if (typeof data == 'string') {
			var self = this;
			TL.ConfigFactory.makeConfig(data, function(config) {
				self.setConfig(config);
			});
		} else if (TL.TimelineConfig == data.constructor) {
			this.setConfig(data);
		} else {
			this.setConfig(new TL.TimelineConfig(data));
		}
	}
187664
protected function writeConfiguration()
    {
        if (! file_exists($file = base_path('phpunit.dusk.xml')) &&
            ! file_exists(base_path('phpunit.dusk.xml.dist'))) {
            copy(realpath(__DIR__.'/../../stubs/phpunit.xml'), $file);

            return;
        }

        $this->hasPhpUnitConfiguration = true;
    }
989099
function instance_config_save($data, $nolongerused = false) {
        global $DB;
        $DB->update_record('block_instances', ['id' => $this->instance->id,
                'configdata' => base64_encode(serialize($data)), 'timemodified' => time()]);
    }
383768
private void configureServer(ServerBartender server)
  {
    // XXX: mixing server/client
    
    ServerNetwork serverNet = _serverMap.get(server.getId());
    
    if (serverNet == null) {
      serverNet = new ServerNetwork(_system, server);
      
      configServer(serverNet, server);

      serverNet.init();
      
      _serverMap.put(server.getId(), serverNet);
    }
  }
476035
public static function set(string $key, string $value): void
    {
        /* Check if initialized */
        if (!self::$initialized) {
            self::initialize();
        }

        /* Check if key exists */
        if (!self::$configs[$key]) {
            return;
        }

        /* Check if values are the same */
        if (self::$configs[$key] == $value) {
            return;
        }

        /* Write to current array */
        self::$configs[$key] = $value;

        /* Write to file */
        file_put_contents(self::$path, self::convertConfigsToFile());
    }