Parse config for individual type (attributes, options, validators, filters...)

@return string|bool
553972
protected function configParser($type, $attribute)
    {
        $config = $this->config();
        if (array_key_exists($type, $config)) {
            $value = $config[$type];
            if (array_key_exists($attribute, $value)) {
                return $value[$attribute];
            }
        }
        return false;
    }
1270499
public function checkConfig()
    {
        $views = [
            $this->fullController,
            $this->action,
        ];

        $this->configIndex = implode('.', array_filter($views));

        return array_get(config('view-routing'), $this->configIndex);
    }
59029
public function formInputConfig()
    {
        $formConfig = parent::formInputConfig();

        if (!array_key_exists('options', $formConfig)) {
            $options = $this->config('options');
            $finder = $this->config('finder');
            if (!empty($options) && is_array($options)) {
                $formConfig['options'] = $options;
            } elseif ($this->_allowedEmptyOptions()) {
            } elseif (!empty($finder)) {
                $formConfig['options'] = $finder;
            }
        }

        return $formConfig;
    }
1009845
public function getConfigNode()
    {
        $node = $this->getChordNode();
        $node
        ->prototype('array')
            ->children()
                ->booleanNode('inline')
                    ->defaultTrue()
                ->end()
                ->enumNode('brand')
                    ->values(array('image', 'text', 'none'))
                    ->defaultValue('text')
                ->end()
                ->arrayNode('parts')
                    ->prototype('array')
                    ->beforeNormalization()
                        ->ifTrue(function ($v) {
                            return 'links' === $v['type'] && isset($v['part']);
                        })
                        ->thenInvalid('Invalid "part" key when type is "links"')
                    ->end()
                    ->beforeNormalization()
                        ->ifTrue(function ($v) {
                            return 'embedded' === $v['type'] && isset($v['parts']);
                        })
                        ->thenInvalid('Invalid "parts" key when type is "embedded"')
                    ->end()
                        ->children()
                            ->enumNode('type')
                                ->values(array('links', 'embedded'))
                            ->end()
                            ->enumNode('position')
                                ->values(array('right', 'left'))
                                ->defaultValue('right')
                            ->end()
                            ->scalarNode('part')->end()
                            ->arrayNode('parts')
                                ->prototype('array')
                                    ->beforeNormalization()
                                        ->ifTrue(function ($v) {
                                            return 'link' === $v['type'] && isset($v['parts']);
                                        })
                                        ->thenInvalid('Invalid "parts" key when type is "link"')
                                    ->end()
                                    ->beforeNormalization()
                                        ->ifTrue(function ($v) {
                                            return 'dropdown' === $v['type'] && isset($v['part']);
                                        })
                                        ->thenInvalid('Invalid "part" key when type is "dropdown"')
                                    ->end()
                                    ->children()
                                        ->enumNode('type')
                                            ->values(array('link', 'dropdown'))
                                        ->end()
                                        ->scalarNode('part')->end()
                                        ->arrayNode('parts')
                                            ->prototype('array')
                                                ->children()
                                                    ->scalarNode('part')->end()
                                                ->end()
                                            ->end()
                                        ->end()
                                    ->end()
                                ->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ->end()
        ->end();

        return $node;
    }
1338136
protected function parseCommonAttributes():string
	{
		$attributes= '';

		$id= $this->sectionLedBy('#')
		 and $this->setAttribute('id',$id);

		$classes= $this->line->pregGet('/ \.[^ ]+(?= |$)/')
		 and preg_match_all('/\.((?(?!\()[^.]+|(?<exp>\((?:[^()]+|(?&exp)?)+?\))))/',$classes,$matches)
		  and $classes= implode(' ',array_filter(array_map(function( $className ){return $this->checkExpression($className);},$matches[1])))
		   and $this->setAttribute('class',$classes);

		$title= $this->sectionLedBy('^',true)
		 and $this->setAttribute('title',$this->checkExpression($title));

		$style= $this->line->pregGet('/ \[([^\]]+;)(?=\]( |$))/',1)
		 and $this->setAttribute('style',$style);

		$eventListeners= $this->line->pregMap('/ %(\w+)\{>(.*?)<\}(?= |$)/',function( $string, $name, $code ){
			$this->setAttribute('on'.$name,str_replace('"','&quot;',$code));
		})
		 and implode('',$eventListeners);

		$other= $this->line->pregGet('/(?<=\{).*?(?=;\}( |$))/')
		 and array_map(function( $keyValue ){
			preg_replace_callback('/^([\w-:]+)(?:\?(.+?))?(?:\=(.*))?$/',function($matches){
				$this->setAttribute($matches[1],(isset($matches[3])? $this->checkExpression($matches[3]) : $matches[1]),$matches[2]??null);
			},$keyValue);
		},explode(';',$other));

		return $attributes;
	}
54270
protected function parseContenttypes()
    {
        $contentTypes = $this->config->get('contenttypes');

        foreach ($contentTypes as $type => $values) {
            $this->getSearchableColumns($type);
            if (isset($values['taxonomy'])) {
                $this->parseTaxonomies($type, $values['taxonomy']);
            }
        }
    }
458422
protected function parseParams():self
	{
		$params= preg_split('/(?<!\\\\)\\|/',$this->line->pregGet('/^-[\w-:]+\((.*?)\)(?= |(\\{>)?$)/',1));

		if( ($m= count($params)) != ($n= count($this->config['params'])) ){$this->document->throw("Tag $this->name has $n parameters $m given.");}

		array_map(function( $key, $value ){return $this->setAttribute($key,$this->checkExpression(str_replace('\\|','|',$value)));},$this->config['params'],$params);

		return $this;
	}
75137
def _config_parse(self):
        """"""
        res = super(cfg.ConfigParser, self).parse(Backend._config_string_io)
        return res
33687
public function parseType()
    {
        if ( ! $this->type ) {
            $this->stream->resetPointer();

            switch ( $this->stream->read(2) ) {
                case "BM":
                    return $this->type = 'bmp';
                case "GI":
                    return $this->type = 'gif';
                case chr(0xFF) . chr(0xd8):
                    return $this->type = 'jpeg';
                case "\0\0":
                    switch ( $this->readByte($this->stream->peek(1)) ) {
                        case 1:
                            return $this->type = 'ico';
                        case 2:
                            return $this->type = 'cur';
                    }

                    return false;

                case chr(0x89) . 'P':
                    return $this->type = 'png';
                case "RI":
                    if ( substr($this->stream->read(10), 6, 4) == 'WEBP' ) {
                        return $this->type = 'webp';
                    }

                    return false;
                case'8B':
                    return $this->type = 'psd';
                case "II":
                case "MM":
                    return $this->type = 'tiff';
                default:
                    $this->stream->resetPointer();

                    // Keep reading bytes until we find '<svg'.
                    while ( true ) {
                        $byte = $this->stream->read( 1 );
                        if ( '<' === $byte && 'svg' === $this->stream->peek( 3 ) ) {
                            $this->type = 'svg';
                            return $this->type;
                        }
                    }
                    return false;
            }
        }

        return $this->type;
    }
524552
private static function getConfig() {

        if(!isset(self::$config)) {

            $default = Format::jsonToArray(File::get('../config/default.config.json'));
            $custom = Format::jsonToArray(File::get('../config/custom.config.json'));

            if ($default && $custom) {

                self::$config = self::merge($default, $custom);
            } else if ($default) {

                self::$config = $default;
            }
        }

        if(isset(self::$config)) {

            return self::$config;
        }        

        return false;
    }
690713
protected function getTypeConfig($type = null)
    {
        if ($type == null) {
            $type = static::BASE_TYPE;
        }

        if (is_object($type)) {
            $type = $this->getTypeName($type);
        }

        if (!$this->types->containsKey($type)) {
            $this->throwInvalidTypeException($type);
        }

        return $this->types->get($type);
    }
1359627
public function &getResourceTypeConfig()
    {
        if (!isset($this->_resourceTypeConfig)) {
            $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
            $this->_resourceTypeConfig = $_config->getResourceTypeConfig($this->_resourceTypeName);
        }

        if (is_null($this->_resourceTypeConfig)) {
            $connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
            $oErrorHandler =& $connector->getErrorHandler();
            $oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_TYPE);
        }

        return $this->_resourceTypeConfig;
    }
834294
public function parse()
    {
        $types = $this->getGenerator()
            ->getSoapClient()
            ->getSoapClient()
            ->getSoapClient()
            ->__getTypes();
        foreach ($types as $type) {
            $this->parseType($type);
        }
    }
529892
public function fileParser()
    {

        $globalFile = '../App/Config/global.php';
        $localFile = '../App/Config/local.php';

        $data = $global = include($globalFile);

        if (file_exists($localFile)) {

            $local = include($localFile);

            // Overlay data config
            $data = array_replace($global, $local);
        }

        // Config validators
        if (!isset($data['session_prefix'])) $data['session_prefix'] = '';
        if (!isset($data['language_code'])) $data['language_code'] = 'en';

        $this->configData = $data;
    }
1233921
public function asConfig()
	{
		// Remove properties that shouldn't be turned into config arrays
		$properties = get_object_vars($this);
		unset($properties['attributeFilters']);
		unset($properties['bundleGenerator']);
		unset($properties['javascript']);
		unset($properties['rendering']);
		unset($properties['rulesGenerator']);
		unset($properties['registeredVars']);
		unset($properties['templateChecker']);
		unset($properties['templateNormalizer']);
		unset($properties['stylesheet']);

		// Create the config array
		$config    = ConfigHelper::toArray($properties);
		$bitfields = RulesHelper::getBitfields($this->tags, $this->rootRules);

		// Save the root context
		$config['rootContext'] = $bitfields['root'];
		$config['rootContext']['flags'] = $config['rootRules']['flags'];

		// Save the registered vars (including the empty ones)
		$config['registeredVars'] = ConfigHelper::toArray($this->registeredVars, true);

		// Make sure those keys exist even if they're empty
		$config += [
			'plugins' => [],
			'tags'    => []
		];

		// Remove unused tags
		$config['tags'] = array_intersect_key($config['tags'], $bitfields['tags']);

		// Add the bitfield information to each tag
		foreach ($bitfields['tags'] as $tagName => $tagBitfields)
		{
			$config['tags'][$tagName] += $tagBitfields;
		}

		// Remove unused entries
		unset($config['rootRules']);

		return $config;
	}
1364975
private function _parse()
    {
        $types = array();

        foreach ($this->parameters as $parameter) {
            /** @var Query\Parameter $parameter */
            $types[$parameter->getName()] = $parameter->getType();
        }

        // Return previous parser result if the query and the filter collection are both clean
        if ($this->_state === self::STATE_CLEAN && $this->_parsedTypes === $types && $this->_em->isFiltersStateClean()) {
            return $this->_parserResult;
        }

        $this->_state = self::STATE_CLEAN;
        $this->_parsedTypes = $types;

        // Check query cache.
        if ( ! ($this->_useQueryCache && ($queryCache = $this->getQueryCacheDriver()))) {
            $parser = new Parser($this);

            $this->_parserResult = $parser->parse();

            return $this->_parserResult;
        }

        $hash   = $this->_getQueryCacheId();
        $cached = $this->_expireQueryCache ? false : $queryCache->fetch($hash);

        if ($cached instanceof ParserResult) {
            // Cache hit.
            $this->_parserResult = $cached;

            return $this->_parserResult;
        }

        // Cache miss.
        $parser = new Parser($this);

        $this->_parserResult = $parser->parse();

        $queryCache->save($hash, $this->_parserResult, $this->_queryCacheTTL);

        return $this->_parserResult;
    }
26420
private function parseConfigFile()
    {
        $activeConfig = $this->getOriginalConfig();
        $activeConfig = $this->beforeExplode($activeConfig);

        //convert into an array
        $activeConfig = explode("\n", $activeConfig);

        $this->activeConfig = $this->afterExplode($activeConfig);

        return !empty($this->activeConfig);
    }