Load Parametrization definition.

return array(
'parameter1' => $config['parameter1'],
'parameter2' => $config['parameter2'],
...
);

@param array $config Bundles config values

@return array
510675
protected function getParametrizationValues(array $config) : array
    {
        return [
            /**
             * Common parameters.
             */
            'controller_extra.resolver_priority' => $config['resolver_priority'],
            'controller_extra.request' => $config['request'],

            /**
             * Form parameters.
             */
            'controller_extra.form_active' => $config['form']['active'],
            'controller_extra.form_default_name' => $config['form']['default_name'],

            /**
             * Flush parameters.
             */
            'controller_extra.flush_active' => $config['flush']['active'],
            'controller_extra.flush_default_manager' => $config['flush']['default_manager'],

            /**
             * Entity parameters.
             */
            'controller_extra.entity_active' => $config['entity']['active'],
            'controller_extra.entity_default_name' => $config['entity']['default_name'],
            'controller_extra.entity_default_persist' => $config['entity']['default_persist'],
            'controller_extra.entity_fallback_mapping' => $config['entity']['fallback_mapping'],
            'controller_extra.entity_default_factory_method' => $config['entity']['default_factory_method'],
            'controller_extra.entity_default_factory_static' => $config['entity']['default_factory_static'],

            /**
             * JsonResponse parameters.
             */
            'controller_extra.json_response_active' => $config['json_response']['active'],
            'controller_extra.json_response_default_status' => $config['json_response']['default_status'],
            'controller_extra.json_response_default_error_status' => $config['json_response']['default_error_status'],
            'controller_extra.json_response_default_headers' => $config['json_response']['default_headers'],

            /**
             * Log parameters.
             */
            'controller_extra.log_active' => $config['log']['active'],
            'controller_extra.log_default_level' => $config['log']['default_level'],
            'controller_extra.log_default_execute' => $config['log']['default_execute'],

            /**
             * Paginator parameters.
             */
            'controller_extra.paginator_active' => $config['paginator']['active'],
            'controller_extra.paginator_default_name' => $config['paginator']['default_name'],
            'controller_extra.paginator_default_page' => $config['paginator']['default_page'],
            'controller_extra.paginator_default_limit_per_page' => $config['paginator']['default_limit_per_page'],

            /**
             * Get parameters.
             */
            'controller_extra.get_active' => $config['get']['active'],

            /**
             * Post parameters.
             */
            'controller_extra.post_active' => $config['post']['active'],
        ];
    }
142799
protected function getConfig(array $config): array
    {
        $keys = ['app_id', 'app_secret'];

        foreach ($keys as $key) {
            if (!array_key_exists($key, $config)) {
                throw new InvalidArgumentException("Missing configuration key [$key].");
            }
        }

        return array_only($config, [
            'app_id',
            'app_secret',
            'default_access_token',
            'default_graph_version',
            'enable_beta_mode',
            'http_client_handler',
            'persistent_data_handler',
            'url_detection_handler',
        ]);
    }
1364783
public function load($config = array())
    {
        $config = new KObjectConfigJson($config);
        $config->append(array(
            'debug' => JFactory::getApplication()->getCfg('debug'),
            'wrapper_class' => array(
                JFactory::getLanguage()->isRtl() ? 'k-ui-rtl' : 'k-ui-ltr'
            )
        ));
        
        if($this->getTemplate()->decorator() === 'koowa')
        {
            $layout = $this->getTemplate()->getParameters()->layout;

            if (JFactory::getApplication()->isSite() && $layout === 'form') {
                $config->domain = 'admin';
            }
        }

        $identifier = $this->getTemplate()->getIdentifier();
        $menu       = JFactory::getApplication()->getMenu()->getActive();

        if ($identifier->type === 'com' && $menu)
        {
            if ($suffix = htmlspecialchars($menu->params->get('pageclass_sfx')))
            {
                $config->append(array(
                    'wrapper_class' => array($suffix)
                ));
            }
        }

        $html = parent::load($config);

        return $html;
    }
320392
protected function normalizeConfig(array $config)
    {
        $final = [];
        foreach ($config as $key => $value) {
            if (is_array($value)) {
                $final[$key] = $this->normalizeConfig($value);
            } else {
                $final[$value] = [];
            }
        }

        return $final;
    }
136957
public function loadFromArray(array $config)
    {
        if (isset($config['domains'])) {
            $this->loadDomainConfiguration($config);
        }

        if (isset($config['general'])) {
            $general = $config['general'];
            $generalConfig = $this->getParsedConfig(
                $general,
                $this->config,
                $this->yamlConfigMap,
                []
            );
            $this->setCache(CacheFactory::get($generalConfig['cacheType'], $generalConfig['cacheOptions']));
            unset($generalConfig['cacheType']);
            unset($generalConfig['cacheOptions']);
            $this->setParsedConfig($generalConfig);
        }

        return $this;
    }
607765
protected function getParametrizationValues(array $config)
    {
        $result = [
            'elcodi.entity.currency.class' => $config['mapping']['currency']['class'],
            'elcodi.entity.currency.mapping_file' => $config['mapping']['currency']['mapping_file'],
            'elcodi.entity.currency.manager' => $config['mapping']['currency']['manager'],
            'elcodi.entity.currency.enabled' => $config['mapping']['currency']['enabled'],

            'elcodi.entity.currency_exchange_rate.class' => $config['mapping']['currency_exchange_rate']['class'],
            'elcodi.entity.currency_exchange_rate.mapping_file' => $config['mapping']['currency_exchange_rate']['mapping_file'],
            'elcodi.entity.currency_exchange_rate.manager' => $config['mapping']['currency_exchange_rate']['manager'],
            'elcodi.entity.currency_exchange_rate.enabled' => $config['mapping']['currency_exchange_rate']['enabled'],

            'elcodi.default_currency' => $config['currency']['default_currency'],
            'elcodi.currency_session_field_name' => $config['currency']['session_field_name'],
        ];

        return $result;
    }
1090951
protected function parseConfig($config)
    {
        $parsed = [];

        foreach ($config as $key=>$value) {
            if ($value instanceof XType) {
                $parsed[$key] = $value;
                continue;
            }
            $parsed[$key] = $this->stringToType($value);
        }

        return $parsed;
    }
135950
protected function flattenConfig(array $config)
	{
		foreach ($config as $k => $v)
		{
			if (is_array($v) && count($v) === 1)
			{
				$config[$k] = end($v);
			}
		}

		return $config;
	}
768503
protected function _paramsTemplate($config)
    {
        $entity = $config->entity;
        $template = $entity->alias;
        $config_file_path = ANPATH_THEMES.DS.$template.DS.'template.json';

        if(!file_exists($config_file_path)) {
           return AnTranslator::_('COM-SETTINGS-PROMPT-NO-CONFIGURATION-AVAILABLE');
        }

        $template_config = json_decode(file_get_contents($config_file_path));

        return $this->_renderForm($template_config->fields, $entity);
    }
1066120
private function loadConfig($config) {
        if(isset($config['moduleConf']['API_USERNAME']) && 
                isset($config['moduleConf']['API_PASSWORD']) && 
                isset($config['moduleConf']['API_SIGNATURE']) &&
                isset($config['moduleConf']['API_ENDPOINT']) &&
                isset($config['moduleConf']['version']) &&
                isset($config['moduleConf']['paypal_url']) && 
                isset($config['moduleConf']['command_url'])){
            $this->setAPI_USERNAME($config['moduleConf']['API_USERNAME']);
            $this->setAPI_PASSWORD($config['moduleConf']['API_PASSWORD']);
            $this->setAPI_SIGNATURE($config['moduleConf']['API_SIGNATURE']);
            $this->setAPI_ENDPOINT($config['moduleConf']['API_ENDPOINT']);
            $this->setVersion($config['moduleConf']['version']);
            $this->setPaypal_url($config['moduleConf']['paypal_url']);
            $this->setCommand_url($config['moduleConf']['command_url']);
        }
        else{
            throw new PaypalException('Missing values in config file.');
        }
    }
752592
protected function loadConfig(array $config)
    {
        $this->config = $config;
        if (array_key_exists('namespaces', $config)) {
            $this->ns = $config['namespaces'];
        }

        $this->defaultContext = $this->getMandatoryKey('defaultContext', $config);

        foreach ($this->getMandatoryKey('data_sources', $config) as $source => $c) {
            if (!array_key_exists('type', $c)) {
                throw new \Tripod\Exceptions\ConfigException("No 'type' set for data source $source");
            }
            if (!array_key_exists('connection', $c)) {
                throw new \Tripod\Exceptions\ConfigException("No connection information set for data source $source");
            }
            $this->dataSources[$source] = $c;
        }

        $transactionConfig = $this->getMandatoryKey('transaction_log', $config);
        $this->tConfig['data_source'] = $this->getMandatoryKey('data_source', $transactionConfig, 'transaction_log');
        if (!isset($this->dataSources[$this->tConfig['data_source']])) {
            throw new \Tripod\Exceptions\ConfigException("Transaction log data source, " . $this->tConfig['data_source'] . ", was not defined");
        }
        $this->tConfig["database"] = $this->getMandatoryKey("database", $transactionConfig, 'transaction_log');
        $this->tConfig["collection"] = $this->getMandatoryKey("collection", $transactionConfig, 'transaction_log');

        // A 'pod' corresponds to a logical database
        $this->databases = $this->getMandatoryKey("stores", $config);
        $defaultDB = null;
        foreach ($this->databases as $storeName => $storeConfig) {
            $this->dbConfig[$storeName] = ["data_source" => $this->getMandatoryKey("data_source", $storeConfig)];
            if (isset($storeConfig['database']) && !empty($storeConfig['database'])) {
                $this->dbConfig[$storeName]["database"]=$storeConfig['database'];
            } else {
                $this->dbConfig[$storeName]["database"] = $storeName;
            }

            $this->cardinality[$storeName] = [];
            $this->indexes[$storeName] = [];
            $this->podConnections[$storeName] = [];
            if (isset($storeConfig["pods"])) {
                foreach ($storeConfig["pods"] as $podName => $podConfig) {
                    $dataSource = (isset($podConfig['data_source']) ? $podConfig['data_source'] : $storeConfig['data_source']);
                    $this->podConnections[$storeName][$podName] = $dataSource;

                    // Set cardinality, also checking against defined namespaces
                    if (array_key_exists('cardinality', $podConfig)) {
                        // Test that the namespace exists for each cardinality rule defined
                        $cardinality = $podConfig['cardinality'];
                        foreach ($cardinality as $qname => $cardinalityValue) {
                            $namespaces = explode(':', $qname);
                            // just grab the first element
                            $namespace  = array_shift($namespaces);

                            if (array_key_exists($namespace, $this->ns)) {
                                $this->cardinality[$storeName][$podName][] = $cardinality;
                            } else {
                                throw new \Tripod\Exceptions\ConfigException("Cardinality '{$qname}' does not have the namespace defined");
                            }
                        }
                    } else {
                        $this->cardinality[$storeName][$podName] = [];
                    }

                    $this->cardinality[$storeName][$podName] = array_key_exists("cardinality", $podConfig) ? $podConfig['cardinality'] : [];

                    // Ensure indexes are legal
                    if (array_key_exists("indexes", $podConfig)) {
                        $this->indexes[$storeName][$podName] = [];
                        foreach ($podConfig["indexes"] as $indexName => $indexFields) {
                            // check no more than 1 indexField is an array to ensure Mongo will be able to create compound indexes
                            if (count($indexFields) > 1) {
                                $fieldsThatAreArrays = 0;
                                foreach ($indexFields as $field => $fieldVal) {
                                    $cardinalityField = str_replace('.value', '', $field);
                                    if (!array_key_exists($cardinalityField, $this->cardinality[$storeName][$podName]) ||
                                        $this->cardinality[$storeName][$podName][$cardinalityField] != 1) {
                                        $fieldsThatAreArrays++;
                                    }
                                    if ($fieldsThatAreArrays > 1) {
                                        throw new \Tripod\Exceptions\ConfigException("Compound index $indexName has more than one field with cardinality > 1 - mongo will not be able to build this index");
                                    }
                                }
                            } // @codeCoverageIgnoreStart
                            // @codeCoverageIgnoreEnd

                            $this->indexes[$storeName][$podName][$indexName] = $indexFields;
                        }
                    }
                }
            }
            if (isset($storeConfig['batch_sizes'])) {
                foreach ([OP_TABLES, OP_SEARCH, OP_VIEWS] as $op) {
                    if (isset($storeConfig['batch_sizes'][$op]) && is_numeric($storeConfig['batch_sizes'][$op])) {
                        $this->batchSize[$op] = intval($storeConfig['batch_sizes'][$op]);
                    }
                }
            }
            $searchConfig = array_key_exists("search_config", $storeConfig) ? $storeConfig["search_config"] : [];
            $this->searchDocSpecs[$storeName] = [];
            if (!empty($searchConfig)) {
                $this->searchProviderClassName[$storeName] = $this->getMandatoryKey('search_provider', $searchConfig, 'search');
                // Load search doc specs if search_config is set
                $searchDocSpecs = $this->getMandatoryKey('search_specifications', $searchConfig, 'search');
                foreach ($searchDocSpecs as $spec) {
                    if (!isset($spec[_ID_KEY])) {
                        throw new \Tripod\Exceptions\ConfigException("Search document spec does not contain " . _ID_KEY);
                    }
                    if (!isset($spec['from']) || !in_array($spec['from'], $this->getPods($storeName))) {
                        throw new \Tripod\Exceptions\ConfigException("'" . $spec[_ID_KEY] . "[\"from\"]' property not set or references an undefined pod");
                    }
                    if (!isset($spec['filter'])) {
                        throw new \Tripod\Exceptions\ConfigException("'" . $spec[_ID_KEY] . "[\"filter\"]' property not set");
                    }

                    if (!isset($spec['fields']) && !isset($spec['joins'])) {
                        throw new \Tripod\Exceptions\ConfigException("'" . $spec[_ID_KEY] . "' contains no 'fields' or 'joins' properties");
                    }

                    if($this->searchProviderClassName[$storeName] == SEARCH_PROVIDER_MONGO)
                    {
                        if(isset($spec['to_data_source']))
                        {
                            if(!isset($this->dataSources[$spec['to_data_source']]))
                            {
                                throw new \Tripod\Exceptions\ConfigException("'" . $spec[_ID_KEY] . "[\"to_data_source\"]' property references an undefined data source");
                            }
                        }
                        else
                        {
                            $spec['to_data_source'] = $storeConfig['data_source'];
                        }
                    }
                    $this->searchDocSpecs[$storeName][$spec[_ID_KEY]] = $spec;
                }
            }

            // Load view specs
            $viewSpecs = (array_key_exists("view_specifications",$storeConfig)) ? $storeConfig["view_specifications"] : [];
            $this->viewSpecs[$storeName] = [];
            foreach ($viewSpecs as $spec)
            {
                if(!isset($spec[_ID_KEY]))
                {
                    throw new \Tripod\Exceptions\ConfigException("View spec does not contain " . _ID_KEY);
                }
                if(!isset($spec['from']) || !in_array($spec['from'], $this->getPods($storeName)))
                {
                    throw new \Tripod\Exceptions\ConfigException("'" . $spec[_ID_KEY] . "[\"from\"]' property not set or references an undefined pod");
                }
                if(!isset($spec['joins']))
                {
                    throw new \Tripod\Exceptions\ConfigException('Could not find any joins in view specification - usecase better served with select()');
                }
                $this->ifCountExistsWithoutTTLThrowException($spec);
                if(isset($spec['to_data_source']))
                {
                    if(!isset($this->dataSources[$spec['to_data_source']]))
                    {
                        throw new \Tripod\Exceptions\ConfigException("'" . $spec[_ID_KEY] . "[\"to_data_source\"]' property references an undefined data source");
                    }
                }
                else
                {
                    $spec['to_data_source'] = $storeConfig['data_source'];
                }
                $this->viewSpecs[$storeName][$spec[_ID_KEY]] = $spec;
            }

            // Load table specs
            $tableSpecs = (array_key_exists("table_specifications",$storeConfig)) ? $storeConfig["table_specifications"] : [];
            $this->tableSpecs[$storeName] = [];
            foreach ($tableSpecs as $spec)
            {
                $this->validateTableSpec($spec);

                if(isset($spec['to_data_source']))
                {
                    if(!isset($this->dataSources[$spec['to_data_source']]))
                    {
                        throw new \Tripod\Exceptions\ConfigException("'" . $spec[_ID_KEY] . "[\"to_data_source\"]' property references an undefined data source");
                    }
                }
                else
                {
                    $spec['to_data_source'] = $storeConfig['data_source'];
                }

                $this->tableSpecs[$storeName][$spec[_ID_KEY]] = $spec;
            }
        }

    }
1358321
protected function parseDescriptorField($config)
    {
        if (is_array($config)) {
            $descriptor = [];
            foreach ($config as $field) {
                if (!empty($this->{$field})) {
                    $descriptor[] = $this->{$field};
                }
            }

            return implode(' ', $descriptor);
        } else {
            return $this->{$config};
        }
    }
963119
public static function config($config = null)
	{
		if(is_array($config)) {

            # Setting Configurations
			static::$config = $config + static::$config;
			$pathWithoutTrailingSlash = rtrim(static::$config['directory'], '/');
			static::$config['directory'] = $pathWithoutTrailingSlash.'/';

		} elseif(is_string($config)) {

            # Getting Single Config item
			return isset(static::$config[$config]) ? static::$config[$config] : null;

		} elseif(!$config) {

            # Getting All configurations
			return static::$config;
		} else {
			throw new CacheException('Invalid parameter provided for Cache::config()');
		}
	}
407487
public function transform(string $config = ''): array
    {
        $parsed = [];

        if (!\extension_loaded('php_yaml')) {
            return $parsed;
        }
        if (!empty($config)) {
            $parsed = \yaml_parse($config);
            $parsed = $parsed !== null ? $parsed : [];
        }

        return $parsed;
    }
441343
public function loadConfig($config = null)
    {
        $config =
            !is_null($config) || !file_exists($this->configFile)
                ? $this->setConfigFile($this->getConfigFile($config))
                : $this->configFile;

        return $this->loadToLaravelConfig($config);
    }
496436
protected function parseConfig(array $config): array
    {
        $result = [];
        foreach ($config as $key => $type) {
            if (\is_array($type)) {
                if ($arrayOfType = $this->factory->checkArrayOfType($type)) {
                    $result[$key] = $arrayOfType;
                } else {
                    $result[$key] = new self($type, $this->factory, $this->strict);
                }
            } elseif ($type instanceof CastInterface) {
                $result[$key] = $type;
            } else {
                $result[$key] = $this->factory->createType($type);
            }
        }

        return $result;
    }
230369
public function getParameters(array $config)
    {
        $params = [
            'opifer_content.content_class' => $config['content']['class'],
            'opifer_content.content_index_view' => $config['content']['views']['index'],
            'opifer_content.content_type_view' => $config['content']['views']['type'],
            'opifer_content.content_edit_type' => $config['content']['views']['edit_type'],
            'opifer_content.content_select_type' => $config['content']['views']['select_type'],
            'opifer_content.content_select_site' => $config['content']['views']['select_site'],
            'opifer_content.content_select_layout_type' => $config['content']['views']['select_layout_type'],
            'opifer_content.content_new_view' => $config['content']['views']['new'],
            'opifer_content.content_design_view' => $config['content']['views']['design'],
            'opifer_content.content_edit_view' => $config['content']['views']['edit'],
            'opifer_content.content_details_view' => $config['content']['views']['details'],
            'opifer_content.content_history_view' => $config['content']['views']['history'],
            'opifer_content.content_type_class' => $config['content_type']['class'],
            'opifer_content.content_type_index_view' => $config['content_type']['views']['index'],
            'opifer_content.content_type_create_view' => $config['content_type']['views']['create'],
            'opifer_content.content_type_edit_view' => $config['content_type']['views']['edit'],
        ];

        // Block configuration
        foreach ($config['blocks'] as $block => $blockConfig) {
            $params['opifer_content.'.$block.'_block_configuration'] = $blockConfig;
        }

        return $params;
    }