Register configs.

@param  string  $separator
336375
protected function registerConfig($separator = '.')
    {
        $this->multiConfigs
            ? $this->registerMultipleConfigs($separator)
            : $this->mergeConfigFrom($this->getConfigFile(), $this->getConfigKey());
    }
424948
protected function registerConfigs()
    {
        $hasNewConfigs = false;

        $yamlConfig = new YamlConfig('', $this->configFiles['config']);
        $parameters = $yamlConfig->read();

        $configs = $this->kernelConfig->getConfigs();

        if (!count($configs)) {
            return;
        }

        foreach ($configs as $config) {
            // Check if the config is already being imported.
            if (VariableUtil::recursiveArraySearch($config, $parameters['imports']) === false) {
                $hasNewConfigs = true;

                // Add the config to the imports
                $parameters['imports'][]['resource'] = $config;
            }
        }

        if (!$hasNewConfigs) {
            return;
        }

        $yamlConfig = new YamlConfig('', $this->configFiles['config']);
        $yamlConfig->write($parameters);
        $yamlConfig->clean();
    }
213348
public function registerHandlersFromConfig()
    {
        $config = $this->container->getConfigInstance();
        foreach ($config->getAJAXTypeHandlers() as $handlerArray) {

            if (isset($handlerArray['path'])) {
                $path = $handlerArray['path'];
                if (!file_exists($path)) {
                    throw new FileNotFoundException($path, "AJAXTypeHandler class file");
                }
                /** @noinspection PhpIncludeInspection */
                require_once $path;
            }

            $className = $handlerArray['class_name'];

            if (!class_exists($className)) {
                throw new ClassNotDefinedException($className);
            }

            $handler = new $className($this->container);

            if($handler instanceof TypeHandlerGenerator){
                $handler = $handler->generateTypeHandler();
            }

            if (!($handler instanceof TypeHandler)) {
                throw new ClassNotInstanceOfException($handler == null ? 'null' : get_class($handler), 'AJAXTypeHandler');
            }

            $this->registerHandler($handler);
        }
    }
685560
public function registerMatcher($matcher)
    {
        if (! in_array($matcher, $this->matchers) && is_a($matcher, MatcherInterface::class, true)) {
            $this->matchers[] = $matcher;
        }

        return $this;
    }
156934
public function configure()
    {
        $name = $this->current();
        $config = $this->config;

        $this->loadConfiguration($name, $config);

        /** @var UniformResourceLocator $locator */
        $locator = $this->grav['locator'];

        $registered = stream_get_wrappers();

        $schemes = $config->get("themes.{$name}.streams.schemes", []);
        $schemes += [
            'theme' => [
                'type' => 'ReadOnlyStream',
                'paths' => $locator->findResources("themes://{$name}", false)
            ]
        ];

        foreach ($schemes as $scheme => $config) {
            if (isset($config['paths'])) {
                $locator->addPath($scheme, '', $config['paths']);
            }
            if (isset($config['prefixes'])) {
                foreach ($config['prefixes'] as $prefix => $paths) {
                    $locator->addPath($scheme, $prefix, $paths);
                }
            }

            if (\in_array($scheme, $registered, true)) {
                stream_wrapper_unregister($scheme);
            }
            $type = !empty($config['type']) ? $config['type'] : 'ReadOnlyStream';
            if ($type[0] !== '\\') {
                $type = '\\RocketTheme\\Toolbox\\StreamWrapper\\' . $type;
            }

            if (!stream_wrapper_register($scheme, $type)) {
                throw new \InvalidArgumentException("Stream '{$type}' could not be initialized.");
            }
        }

        // Load languages after streams has been properly initialized
        $this->loadLanguages($this->config);
    }
191253
public function loadConfiguration(): void
	{
		$config = $this->validateConfig($this->defaults, $this->config);

		foreach ($config as $bridge => $enabled) {
			// Don't register sub extension
			if ($enabled === false) {
				continue;
			}

			// Security check
			Validators::assertField($config, $bridge, 'array');

			// Register sub extension a.k.a CompilerPass
			$this->passes[$bridge] = new $this->map[$bridge]();
			$this->passes[$bridge]->setCompiler($this->compiler, $this->prefix($bridge));
			$this->passes[$bridge]->setConfig($this->config[$bridge] ?? []);
			$this->passes[$bridge]->loadConfiguration();
		}
	}
1181819
protected function registerBindings()
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $config = $this->app['config']->get('elasticsearch', []);

        $this->app->/** @scrutinizer ignore-call */ singleton(ElasticsearchServiceContract::class, function () use ($config) {
            return new ElasticsearchService(ClientBuilder::fromConfig($config));
        });
    }
1115217
protected function _setPathSegmentSeparator($separator)
    {
        if (
            !($separator instanceof Stringable) &&
            !is_string($separator) &&
            !is_null($separator)
        ) {
            throw $this->_createInvalidArgumentException($this->__('Invalid path segment separator'), null, null, $separator);
        }

        $this->pathSegmentSeparator = $separator;
    }
1073639
protected function registerConfigFiles()
    {
        if (isset($this->dir) and isset($this->configFiles) and is_array($this->configFiles)) {
            foreach ($this->configFiles as $key) {
                $path = $this->getConfigFilePath($key);
                //$this->mergeConfigFrom($this->getConfigFilePath($filename), $filename);
                $config = $this->app->make('config')->get($key, [ ]);
                $this->app->make('config')->set($key, array_replace_recursive(require $path, $config));
            }
        }
    }
837254
public function register(Renderer $renderer) {
        $this->registerTokenRenderer(ItalicRule::NAME . ItalicRule::OPEN, 'renderOpen', $renderer);
        $this->registerTokenRenderer(ItalicRule::NAME . ItalicRule::CLOSE, 'renderClose', $renderer);

        $this->registerTokenRenderer(ItalicAltRule::NAME . ItalicAltRule::OPEN, 'renderOpen', $renderer);
        $this->registerTokenRenderer(ItalicAltRule::NAME . ItalicAltRule::CLOSE, 'renderClose', $renderer);
    }
1335438
protected function addJoinExpression($expression, string $separator = 'AND')
    {
        if ($expression instanceof Closure) {
            $expression = Expression::fromClosure($expression);
        }

        $this->conditions[] = [
            'type' => 'joinExpression',
            'expression' => $expression,
            'separator' => $separator,
        ];

        return $this;
    }
14966
public function addSeparator($token)
    {
        $this->wikiContent .= $this->wikiContentArr[$this->separatorCount];
        ++$this->separatorCount;
        if ($this->separatorCount > count($this->separators)) {
            $this->currentSeparator = end($this->separators);
        } else {
            $this->currentSeparator = $this->separators[$this->separatorCount - 1];
        }
        $this->wikiContent .= $this->currentSeparator;
        $this->contents[$this->separatorCount] = '';
        $this->wikiContentArr[$this->separatorCount] = '';
    }
1272585
protected function registerConfig()
    {
        $config = $this->config = app('PragmaRX\Tddd\Package\Services\Config');

        $this->app->singleton('tddd.config', function () use ($config) {
            return $config;
        });
    }
410796
protected function registerConfigurations()
    {
        $this->mergeConfigFrom($this->packagePath('config/config.php'), 'laravolt.avatar');
        $this->publishes([$this->packagePath('config/config.php') => config_path('laravolt/avatar.php')], 'config');
    }
1019654
protected function register($config)
    {
        $this->validators = array();

        if (array_key_exists( 'length', $config ) && (int) $config['length']) {
            $this->validators[] = new \tao_helpers_form_validators_Length( array( 'min' => (int) $config['length'] ) );
        }

        if (( array_key_exists( 'upper', $config ) && $config['upper'] )
            || ( array_key_exists( 'lower', $config ) && $config['lower'] )
        ) {
            $this->validators[] = new \tao_helpers_form_validators_Regex(
                array(
                    'message' => __( 'Must include at least one letter' ),
                    'format'  => '/\pL/'
                ), 'letters'
            );
        }

        if (( array_key_exists( 'upper', $config ) && $config['upper'] )) {
            $this->validators[] = new \tao_helpers_form_validators_Regex(
                array(
                    'message' => __( 'Must include upper case letters' ),
                    'format'  => '/(\p{Lu}+)/',
                ), 'caseUpper'
            );
        }

        if (( array_key_exists( 'lower', $config ) && $config['lower'] )) {
            $this->validators[] = new \tao_helpers_form_validators_Regex(
                array(
                    'message' => __( 'Must include lower case letters' ),
                    'format'  => '/(\p{Ll}+)/'
                ), 'caseLower'
            );
        }

        if (array_key_exists( 'number', $config ) && $config['number']) {
            $this->validators[] = new \tao_helpers_form_validators_Regex(
                array(
                    'message' => __( 'Must include at least one number' ),
                    'format'  => '/\pN/'
                ), 'number'
            );
        }

        if (array_key_exists( 'spec', $config ) && $config['spec']) {
            $this->validators[] = new \tao_helpers_form_validators_Regex(
                array(
                    'message' => __( 'Must include at least one special letter' ),
                    'format'  => '/[^p{Ll}\p{Lu}\pL\pN]/'
                ), 'spec'
            );
        }

    }
1157679
private function setConfigToConfiguratorService(array $configArr) : void
    {
        $config = $this->container->get(ConfigInterface::class);
        $config->setConfig($configArr);
    }
225546
public static function registerFilters(Isolator $isolator = null)
    {
        $isolator = Isolator::get($isolator);

        $isolator->stream_filter_register(
            'endec.base16-encode',
            'Eloquent\Endec\Base16\Base16EncodeNativeStreamFilter'
        );
        $isolator->stream_filter_register(
            'endec.base16-decode',
            'Eloquent\Endec\Base16\Base16DecodeNativeStreamFilter'
        );
        $isolator->stream_filter_register(
            'endec.base32-encode',
            'Eloquent\Endec\Base32\Base32EncodeNativeStreamFilter'
        );
        $isolator->stream_filter_register(
            'endec.base32-decode',
            'Eloquent\Endec\Base32\Base32DecodeNativeStreamFilter'
        );
        $isolator->stream_filter_register(
            'endec.base32hex-encode',
            'Eloquent\Endec\Base32\Base32HexEncodeNativeStreamFilter'
        );
        $isolator->stream_filter_register(
            'endec.base32hex-decode',
            'Eloquent\Endec\Base32\Base32HexDecodeNativeStreamFilter'
        );
        $isolator->stream_filter_register(
            'endec.base64-encode',
            'Eloquent\Endec\Base64\Base64EncodeNativeStreamFilter'
        );
        $isolator->stream_filter_register(
            'endec.base64-decode',
            'Eloquent\Endec\Base64\Base64DecodeNativeStreamFilter'
        );
        $isolator->stream_filter_register(
            'endec.base64mime-encode',
            'Eloquent\Endec\Base64\Base64MimeEncodeNativeStreamFilter'
        );
        $isolator->stream_filter_register(
            'endec.base64mime-decode',
            'Eloquent\Endec\Base64\Base64MimeDecodeNativeStreamFilter'
        );
        $isolator->stream_filter_register(
            'endec.base64url-encode',
            'Eloquent\Endec\Base64\Base64UrlEncodeNativeStreamFilter'
        );
        $isolator->stream_filter_register(
            'endec.base64url-decode',
            'Eloquent\Endec\Base64\Base64UrlDecodeNativeStreamFilter'
        );
        $isolator->stream_filter_register(
            'endec.uri-encode',
            'Eloquent\Endec\Uri\UriEncodeNativeStreamFilter'
        );
        $isolator->stream_filter_register(
            'endec.uri-decode',
            'Eloquent\Endec\Uri\UriDecodeNativeStreamFilter'
        );
    }