Dumps settings contained in $configArray in ezpublish.yml.

@param array $configArray hash of settings
@param int $options A binary combination of options. See class OPT_* class constants in {@link \eZ\Publish\Core\MVC\Symfony\ConfigDumperInterface}
978596
public function dump(array $configArray, $options = ConfigDumperInterface::OPT_DEFAULT)
    {
        $configPath = "$this->rootDir/config";
        $mainConfigFile = "$configPath/ezpublish.yml";
        if ($this->fs->exists($mainConfigFile) && $options & static::OPT_BACKUP_CONFIG) {
            $this->backupConfigFile($mainConfigFile);
        }

        file_put_contents($mainConfigFile, Yaml::dump($configArray, 7));

        // Now generates environment config files
        foreach (array_keys($this->envs) as $env) {
            $configFile = "$configPath/ezpublish_{$env}.yml";
            // Add the import statement for the root YAML file
            $envConfigArray = [
                'imports' => [['resource' => 'ezpublish.yml']],
            ];

            // File already exists, handle possible options
            if ($this->fs->exists($configFile) && $options & static::OPT_BACKUP_CONFIG) {
                $this->backupConfigFile($configFile);
            }

            file_put_contents($configFile, Yaml::dump($envConfigArray, 7));
        }

        $this->clearCache();
    }
1331108
function ResetConfigArray($array_to_reset = '')
  {
      if (!is_array($array_to_reset)) {
        $array_to_reset = $this->_sql_tables_schema['config'];
      }
      // First, we reset all values (we know the key based on the schema)
      reset($array_to_reset);
      while(list($valid_key, $valid_format) = @each($array_to_reset)) {
          $pos = mb_strpos(mb_strtoupper($valid_format), 'DEFAULT');
          $value = "";
          if ($pos !== FALSE) {
              $value = trim(substr($valid_format, $pos + strlen("DEFAULT")));
              if (("'" == substr($value,0,1)) && ("'" == substr($value,-1))) {
                  $value = substr($value,1,-1);
              }
          }
          $this->_config_data[$valid_key] = $value;
      }
  }
298609
private function loadFromArray($configList)
    {
        foreach ($configList as $section => $config) {
            foreach ($config as $key => $value) {
                $this->set($section . '.' . $key, $value);
            }
        }
    }
535456
public function configure($_array = NULL) {
		if ( $_array != NULL ) {
			if ( isset( $_array['x'] ) ) $this->_config['x'] = $_array['x'];
			if ( isset( $_array['y'] ) ) $this->_config['y'] = $_array['y'];
			if ( isset( $_array['w'] ) ) $this->_config['w'] = $_array['w'];
			if ( isset( $_array['h'] ) ) $this->_config['h'] = $_array['h'];
			if ( isset( $_array['f'] ) ) $this->_config['f'] = $_array['f'];
		}
		return self::$_instance;
	}
469162
final public static function setConfigDefault(array $config = [])
    {
        $calledClass = get_called_class();

        if (!isset(self::$loadedConfigSet[$calledClass])) {
            static::$config = $config;
        } else {
            self::$loadedConfigSet[$calledClass] = array_merge(self::$configDefault, $config);
        }

        return true;
    }
155350
function config_form($preferences){
        global $USER, $OUTPUT, $CFG;
        $string = '';

        $choices = array();
        $choices['0'] = get_string('textformat');
        $choices['1'] = get_string('htmlformat');
        $current = $preferences->mailformat;
        $string .= $OUTPUT->container(html_writer::label(get_string('emailformat'), 'mailformat'));
        $string .= $OUTPUT->container(html_writer::select($choices, 'mailformat', $current, false, array('id' => 'mailformat')));
        $string .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'userid', 'value' => $USER->id));

        if (!empty($CFG->allowusermailcharset)) {
            $choices = array();
            $charsets = get_list_of_charsets();
            if (!empty($CFG->sitemailcharset)) {
                $choices['0'] = get_string('site').' ('.$CFG->sitemailcharset.')';
            } else {
                $choices['0'] = get_string('site').' (UTF-8)';
            }
            $choices = array_merge($choices, $charsets);
            $current = $preferences->mailcharset;
            $string .= $OUTPUT->container(html_writer::label(get_string('emailcharset'), 'mailcharset'));
            $string .= $OUTPUT->container(
                html_writer::select($choices, 'preference_mailcharset', $current, false, array('id' => 'mailcharset'))
            );
        }

        if (!empty($CFG->messagingallowemailoverride)) {
            $inputattributes = array('size' => '30', 'name' => 'email_email', 'value' => $preferences->email_email,
                    'id' => 'email_email');
            $string .= html_writer::label(get_string('email', 'message_email'), 'email_email');
            $string .= $OUTPUT->container(html_writer::empty_tag('input', $inputattributes));

            if (empty($preferences->email_email) && !empty($preferences->userdefaultemail)) {
                $string .= $OUTPUT->container(get_string('ifemailleftempty', 'message_email', $preferences->userdefaultemail));
            }

            if (!empty($preferences->email_email) && !validate_email($preferences->email_email)) {
                $string .= $OUTPUT->container(get_string('invalidemail'), 'error');
            }

            $string .= '<br/>';
        }

        return $string;
    }
774370
private function readConfigurationFile(string $configFilename): void
  {
    // Read the configuration file.
    $settings = parse_ini_file($configFilename, true);

    // Set default values.
    if (!isset($settings['wrapper']['lob_as_string']))
    {
      $settings['wrapper']['lob_as_string'] = false;
    }

    if (!isset($settings['wrapper']['strict_types']))
    {
      $settings['wrapper']['strict_types'] = true;
    }

    $this->wrapperClassName = self::getSetting($settings, false, 'wrapper', 'wrapper_class');
    if ($this->wrapperClassName!==null)
    {
      $this->parentClassName  = self::getSetting($settings, true, 'wrapper', 'parent_class');
      $this->nameMangler      = self::getSetting($settings, true, 'wrapper', 'mangler_class');
      $this->wrapperFilename  = self::getSetting($settings, true, 'wrapper', 'wrapper_file');
      $this->lobAsString      = !empty(self::getSetting($settings, true, 'wrapper', 'lob_as_string'));
      $this->metadataFilename = self::getSetting($settings, true, 'loader', 'metadata');
      $this->wrapperClassType = self::getSetting($settings, true, 'wrapper', 'wrapper_type');
      $this->strictTypes      = !empty(self::getSetting($settings, true, 'wrapper', 'strict_types'));
    }
  }
388271
private function generateArray(array $config)
    {
        ++$this->indent;

        foreach ($config as $key => $value) {
            if (is_null($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, 'null'));
                } else {
                    $this->writeLine(sprintf('%s,', 'null'));
                }
            } elseif (is_bool($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, $value ? 'true' : 'false'));
                } else {
                    $this->writeLine(sprintf('%s,', $value ? 'true' : 'false'));
                }
            } elseif (is_string($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => '%s',", $key, $value));
                } else {
                    $this->writeLine(sprintf("'%s',", $value));
                }
            } elseif (is_array($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => [", $key));
                } else {
                    $this->writeLine('[');
                }

                $this->generateArray($value);

                $this->writeLine('],');
            } elseif ($value instanceof ClassName) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, (string) $value));
                } else {
                    $this->writeLine(sprintf('%s,', (string) $value));
                }
            } else {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, $value));
                } else {
                    $this->writeLine($value.',');
                }
            }
        }

        --$this->indent;
    }
254810
protected function setOptions(array $options = []): void
    {
        $this->options = $options;
        $this->configName = empty($options['cacheConfig']) ? static::DEFAULT_CONFIG : (string)$options['cacheConfig'];
        $this->skipCache = empty($this->options['cacheSkip']) ? false : (bool)$this->options['cacheSkip'];
    }
498786
private function setConfigOptions(array $config_array)
    {
        foreach ($config_array as $type => $value) {
            $this->setConfigOption($type, $value);
        }

        return true;
    }
794634
public static function setConfig($config = [])
    {
        if (!is_array($config)) {
            return false;
        }
        self::$config = array_merge(self::$config, $config);
        return true;
    }
651652
protected function set_settings() {

		// If settings is not an array, temporarily convert it to an array.
		// This is just to allow us to process everything the same way and avoid code duplication.
		// if settings is not an array then it will not be set as an array in the end.
		if ( ! is_array( $this->settings ) ) {
			$this->settings = [
				'kirki_placeholder_setting' => $this->settings,
			];
		}
		$settings = [];
		foreach ( $this->settings as $setting_key => $setting_value ) {
			$settings[ $setting_key ] = $setting_value;

			// If we're using serialized options then we need to spice this up.
			if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) {
				$settings[ $setting_key ] = "{$this->option_name}[{$setting_value}]";
			}
		}
		$this->settings = $settings;
		if ( isset( $this->settings['kirki_placeholder_setting'] ) ) {
			$this->settings = $this->settings['kirki_placeholder_setting'];
		}
	}
286660
private function addConfigArrays()
    {
        $this->info("Adding the 'locales' and 'skip_locales' arrays to config/app.php");
        $this->helper->replaceAndSave($this->config->paths->config->app, $this->oldLocalesString, $this->newLocalesString);
        $this->bar->advance();
    }
211099
protected function parseConfig(array $options)
    {
        if (!isset($options['table']) || empty($options['table'])) {
            throw new InvalidArgumentException($this->translate(
                'Cannot find table settings in configuration.'
            ));
        }

        if (!is_array($options['table'])) {
            throw new InvalidArgumentException($this->translate(
                'Table settings should be an array or Traversable.'
            ));
        }

        if (!isset($options['table']['tableName']) || empty($options['table']['tableName'])) {
            throw new InvalidArgumentException($this->translate(
                'Cannot find table name in configuration.'
            ));
        }
        if (!isset($options['table']['keyColumnName']) || empty($options['table']['keyColumnName'])) {
            throw new InvalidArgumentException($this->translate(
                'Cannot find key column name in configuration.'
            ));
        }

        if (!isset($options['table']['valueColumnName']) || empty($options['table']['valueColumnName'])) {
            throw new InvalidArgumentException($this->translate(
                'Cannot find value column name in configuration.'
            ));
        }

        if (!isset($options['table']['expireColumnName']) || empty($options['table']['expireColumnName'])) {
            throw new InvalidArgumentException($this->translate(
                'Cannot find expire column name in configuration.'
            ));
        }

        return $options;
    }
677220
public function setOptionsArray($options) {
    foreach($options as $key => $value) {
      if (!$this->setOption($key, $value)) {
        return false;
      }
    }
    return true;
  }
1290797
public function setConfig($config)
    {
        if (is_array($config)) {
            $this->config = $config;
        } else {
            $this->config = (array) gplcart_config_get((string) $config);
            $this->setDb($this->config['database']);
            $this->config = array_merge($this->config, $this->select());
        }
    }
369701
private function _formSaveConfigParameters($configKey, $configParameters)
    {
        $type = null;
        if (isset($configParameters['type'])) {
            $type = $configParameters['type'];
        }

        $value = null;
        if (isset($configParameters['value'])) {
            $value = $configParameters['value'];
        }

        $module = null;
        if (isset($configParameters['module'])) {
            $module = $configParameters['module'];
        }

        if (($type == "arr" || $type == 'aarr') && !is_array($value)) {
            $value = unserialize(htmlspecialchars_decode($value));
        }
        return !empty($type) ? array($type, $configKey, $value, null, $module) : false;
    }