Add section data to the configuration.

@param string $section
@param array $config
979140
public function add($section, $config = array())
    {
        if (! isset($this->config[$section])) {
            $this->config[$section] = array();
        }

        $this->config[$section] = array_merge($this->config[$section], $config);
    }
1111775
protected function loadDomainConfiguration(array $config)
    {
        try {
            foreach ($config['domains'] as $domain => $options) {
                $domain = new DomainConfiguration();
                $domain->load($options);
                $this->addDomain($domain);
            }
        } catch (ConfigurationException $e) {
            throw new ConfigurationException(sprintf("Error in domain config section: %s", $e->getMessage()));
        }
    }
505982
private function updateConfigOverridedSectionsForSite(Config $config)
    {
        if (false === $this->application->isStarted()) {
            throw new BBException('Application is not started, we are not able to persist multiple site config.');
        }

        $default_sections = $this->configurator->getConfigDefaultSections($config);
        $current_sections = $config->getAllRawSections();

        $sections_to_update = array_keys(Collection::array_diff_assoc_recursive($default_sections, $current_sections));
        $sections_to_update = array_unique(array_merge(
            $sections_to_update,
            array_keys(Collection::array_diff_assoc_recursive($current_sections, $default_sections))
        ));

        $override_site = $config->getRawSection('override_site') ?: array();
        $site_uid = $this->application->getSite()->getUid();
        if (false === array_key_exists($site_uid, $override_site)) {
            $override_site[$site_uid] = array();
        }

        $override_sections_site = &$override_site[$site_uid];

        foreach ($sections_to_update as $section) {
            if ('override_site' !== $section) {
                $override_sections_site[$section] = $config->getRawSection($section);
            }
        }

        $config->deleteAllSections();
        foreach ($this->configurator->getConfigDefaultSections($config) as $section_name => $section_settings) {
            $config->setSection($section_name, $section_settings);
        }

        $config->setSection('override_site', $override_site, true);
    }
489354
public function getSection($section) {
		if (!isset($this->configValues[$section])) {
			return null;
		}
		return $this->configValues[$section];
	}
612855
public function parseSections(array $sections, Configuration $configuration = null)
    {
        if (is_null($configuration)) {
            $configuration = new Configuration();
        }

        foreach ($sections as $sectionName => $section) {
            $name = explode(':', $sectionName, 2);

            $class = $configuration->findSection($name[0]);

            if (false === $class) {
                $class = 'Supervisor\Configuration\Section\GenericSection';
                $name[1] = $sectionName;
            }

            if (isset($name[1])) {
                $section = new $class($name[1], $section);
            } else {
                $section = new $class($section);
            }

            $configuration->addSection($section);
        }

        return $configuration;
    }
658361
private static function processSection($section, array $contents)
    {
        // the section does not extend another section
        if (stripos($section, ':') === false) {
            self::$result[$section] = self::processSectionContents($contents);
            
            // section extends another section
        } else {
            // extract section names
            list ($ext_target, $ext_source) = explode(':', $section);
            $ext_target = trim($ext_target);
            $ext_source = trim($ext_source);
            
            // check if the extended section exists
            if (! isset(self::$result[$ext_source])) {
                throw new \Exception('Unable to extend section ' . $ext_source . ', section not found');
            }
            
            // process section contents
            self::$result[$ext_target] = self::processSectionContents($contents);
            
            // merge the new section with the existing section values
            self::$result[$ext_target] = self::arrayMergeRecursive(self::$result[$ext_source], self::$result[$ext_target]);
        }
    }
353098
public function make_section_constants($section) {
		if(!is_null($section) && strlen($section) && in_array($section, $this->get_valid_sections())) {
			foreach($this->fullConfig[$section] as $k=>$parsedValue) {
				//TODO: implement option to set a section/value as a CONSTANT
				$constantName = $k;
				if(!defined($constantName)) {
					define($constantName, $parsedValue);
				}
				
				$constantPlusSection = preg_replace('~\-~', '_', $section) .'-'. $constantName;
				if(!defined($constantPlusSection)) {
					define($constantPlusSection, $parsedValue);
				}
			}
		}
		else {
			throw new InvalidArgumentException("non-existent section, '". $section ."'");
		}
	}
59695
public static function createFromEdgeRcFile($section = 'default', $path = null)
    {
        if ($section === null) {
            $section = 'default';
        }

        $ini = self::parseEdgeRcFile($path);

        if (!isset($ini[$section])) {
            throw new ConfigException("Section \"$section\" does not exist!");
        }

        $auth = new static();
        $auth->setAuth(
            $ini[$section]['client_token'],
            $ini[$section]['client_secret'],
            $ini[$section]['access_token']
        );

        if (isset($ini[$section]['host'])) {
            $auth->setHost($ini[$section]['host']);
        }

        if (isset($ini[$section]['max-size'])) {
            $auth->setMaxBodySize($ini[$section]['max-size']);
        }

        return $auth;
    }
101405
public function addSection( $section )
	{
		if ( !( isset( $this->data[$section] ) && is_array( $this->data[$section] ) ) )
			$this->data[$section]	= array();
		$this->currentSection	= $section;
	}
913712
public void addSection(final Section SECTION) {
        if (null == SECTION) return;
        sections.add(SECTION);
        Collections.sort(sections, new SectionComparator());
        fireUpdateEvent(SECTION_EVENT);
    }
581955
public function setConfigValue( $section, $key, $value )
	{
		$this->config[$section][$key] = $value;
		$this->write();
	}
534719
public function configASectionedCRUD($config, $section, $table, $splitTable)
    {
        $appPath = app()->path();
        $basePath = app()->basePath();
        $appNamespace = $this->appService->getAppNamespace();

        $sectionalConfig = [
            '_sectionPrefix_'            => strtolower($section).'.',
            '_sectionTablePrefix_'       => strtolower($section).'_',
            '_sectionRoutePrefix_'       => strtolower($section).'/',
            '_sectionNamespace_'         => ucfirst($section).'\\',
            '_path_facade_'              => $appPath.'/Facades',
            '_path_service_'             => $appPath.'/Services',
            '_path_model_'               => $appPath.'/Models/'.ucfirst($section).'/'.ucfirst($table),
            '_path_controller_'          => $appPath.'/Http/Controllers/'.ucfirst($section).'/',
            '_path_api_controller_'      => $appPath.'/Http/Controllers/Api/'.ucfirst($section).'/',
            '_path_views_'               => $basePath.'/resources/views/'.strtolower($section),
            '_path_tests_'               => $basePath.'/tests',
            '_path_request_'             => $appPath.'/Http/Requests/'.ucfirst($section),
            '_path_routes_'              => $appPath.'/Http/routes.php',
            '_path_api_routes_'          => $appPath.'/Http/api-routes.php',
            '_path_migrations_'          => $basePath.'/database/migrations',
            '_path_factory_'             => $basePath.'/database/factories/'.snake_case($table).'Factory.php',
            'routes_prefix'              => "\n\nRoute::group(['namespace' => '".ucfirst($section)."', 'prefix' => '".strtolower($section)."', 'middleware' => ['web']], function () { \n",
            'routes_suffix'              => "\n});",
            '_app_namespace_'            => $appNamespace,
            '_namespace_services_'       => $appNamespace.'Services\\'.ucfirst($section),
            '_namespace_facade_'         => $appNamespace.'Facades',
            '_namespace_model_'          => $appNamespace.'Models\\'.ucfirst($section).'\\'.ucfirst($table),
            '_namespace_controller_'     => $appNamespace.'Http\Controllers\\'.ucfirst($section),
            '_namespace_api_controller_' => $appNamespace.'Http\Controllers\Api\\'.ucfirst($section),
            '_namespace_request_'        => $appNamespace.'Http\Requests\\'.ucfirst($section),
            '_lower_case_'               => strtolower($splitTable[1]),
            '_lower_casePlural_'         => str_plural(strtolower($splitTable[1])),
            '_camel_case_'               => ucfirst(camel_case($splitTable[1])),
            '_camel_casePlural_'         => str_plural(camel_case($splitTable[1])),
            '_ucCamel_casePlural_'       => ucfirst(str_plural(camel_case($splitTable[1]))),
            '_table_name_'               => str_plural(strtolower(implode('_', $splitTable))),
        ];

        $config = array_merge($config, $sectionalConfig);
        $config = array_merge($config, app('config')->get('crudmaker.sectioned', []));
        $config = $this->setConfig($config, $section, $table);

        $pathsToMake = [
            '_path_model_',
            '_path_controller_',
            '_path_api_controller_',
            '_path_views_',
            '_path_request_',
        ];

        foreach ($config as $key => $value) {
            if (in_array($key, $pathsToMake) && !file_exists($value)) {
                mkdir($value, 0777, true);
            }
        }

        return $config;
    }
422614
def configure(self, config):
        
        parameters = config.get_section("parameters")
        if len(parameters) > 0:
            self._parameters = parameters
651519
public function addOption( array $config ) {
        $opt = new Option;

        $opt->setAttributes( $config );

        $this->addChild( $opt );
    }
439737
private function _changeSectionName(&$array, $section)
    {
        $sectionName = explode(':', $section);

        if (sizeof($sectionName) > 1) {

            $newSectionName = trim($sectionName[0]);
            $array[$newSectionName] = $array[$section];
            unset($array[$section]);
        }
    }
632459
protected function processSection(array $section)
    {
        foreach ($section as $key => $value) {
            $tok = new Token();
            $tok->setKey($key);
            $tok->setValue($value);
            $this->tokens[] = $tok;
        }
    }
242226
protected function addSection($section, $contents, $overwrite = false)
    {
        if ($overwrite || !isset($this->sections[$section])) {
            $this->sections[$section] = $contents;
        }

        return $this;
    }