Filtering by configuration.
@since 0.2.2
@throws InvalidConfigException
775186
protected function filtering()
    {
        $app = Yii::$app;
        if ($this->statusCode) {
            if (is_integer($this->statusCode)) {
                if ($app->getRequest()->getIsAjax()) {
                    $app->getResponse()->setStatusCode(self::STATUS_CODE_OK);
                } else {
                    $app->getResponse()->setStatusCode($this->statusCode);
                    if ($this->retryAfter){
                        $app->getResponse()->getHeaders()->set('Retry-After', $this->retryAfter);
                    }
                }
            } else {
                throw new InvalidConfigException('Parameter "statusCode" should be an integer.');
            }
        }
        // Check users
        if ($this->users) {
            if (is_array($this->users)) {
                $this->disable = $app->getUser()->getIdentity()
                    ? in_array($app->getUser()->getIdentity()->{$this->usernameAttribute}, $this->users)
                    : false;
            } elseif (is_string($this->users)) {
                $this->disable = $app->getUser()->getIdentity()->{$this->usernameAttribute} === $this->users;
            } else {
                throw new InvalidConfigException('Parameter "users" should be an array or string.');
            }
        }
        // Check roles
        if ($this->roles) {
            if (is_array($this->roles)) {
                foreach ($this->roles as $role) {
                    $this->disable = $this->disable || $app->getUser()->can($role);
                }
            } else {
                throw new InvalidConfigException('Parameter "roles" should be an array.');
            }
        }
        // Check URL's
        if ($this->urls) {
            if (is_array($this->urls)) {
                $this->disable = $this->disable || in_array($app->getRequest()->getPathInfo(), $this->urls);
            } else {
                throw new InvalidConfigException('Parameter "urls" should be an array.');
            }
        }
        // Check IP's
        if ($this->ips) {
            if (is_array($this->ips)) {
                foreach ($this->ips as $filter) {
                    $this->disable = $this->disable || $this->checkIp($filter);
                }
            } elseif (is_string($this->ips)){
                $this->disable = $this->disable || $this->checkIp($this->ips);
            } else {
                throw new InvalidConfigException('Parameter "ips" should be an array.');
            }
        }
        if (!$this->disable) {
            if ($this->route === 'maintenance/index') {
                $app->controllerMap['maintenance'] = 'brussens\maintenance\controllers\MaintenanceController';
            }
            $app->catchAll = [$this->route];
        } else {
            $app->getResponse()->setStatusCode(self::STATUS_CODE_OK);
        }
    }
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);
    }
952366
protected synchronized void bindFilterConfiguration(final FilterConfiguration config) {
        if (filterConfigurations == null) {
            filterConfigurations = new ArrayList<>();
        }
        filterConfigurations.add(config);
        String key = config.getName();
        ResourceFilter filter = config.getFilter();
        if (StringUtils.isNotBlank(key) && filter != null) {
            nodeFilters.put(key, buildTreeFilter(filter));
        }
    }
1092930
private final static void loadConfig() {
		try {
			conf = Configurations.loadConfig(configFilePath);
		} catch (ConfigurationException e) {
			terminate();
			throw new InitializationException(INIT_FAILED, e);
		}
	}
137688
public function init()
    {
        if (empty($this->models) && !$this->modelClass) {
            throw new InvalidConfigException('You must at least specify "models" or "modelClass"');
        }

        if ($this->form !== null && !$this->form instanceof ActiveForm) {
            throw new InvalidConfigException('Property "form" must be an instance of yii\widgets\ActiveForm');
        }

        if (!is_array($this->models)) {
            throw new InvalidConfigException('Property "models" must be an array');
        }

        if ($this->models) {
            $modelClasses = [];
            foreach ($this->models as $model) {
                if (!$model instanceof Model) {
                    throw new InvalidConfigException('Model has to be an instance of yii\base\Model');
                }

                $modelClasses[get_class($model)] = true;
            }

            if (count($modelClasses) > 1) {
                throw new InvalidConfigException("You cannot use models of different classes");
            }

            $this->modelClass = key($modelClasses);
        }

        parent::init();
    }
1222730
@Override
    @FFDCIgnore(SecurityException.class)
    public ExtendedConfiguration[] listConfigurations(String filterString) throws InvalidSyntaxException {
        if (filterString == null)
            filterString = "(" + Constants.SERVICE_PID + "=*)"; //$NON-NLS-1$ //$NON-NLS-2$

        try {
            this.caFactory.checkConfigurationPermission();
        } catch (SecurityException e) {
            filterString = "(&(" + ConfigurationAdmin.SERVICE_BUNDLELOCATION + "=" + bundle.getLocation() + ")" + filterString + ")";
        }
        return caFactory.getConfigurationStore().listConfigurations(FrameworkUtil.createFilter(filterString));
    }
400539
public function init()
    {
        parent::init();

        // check for BC
        if (!empty($this->cookieName)) {
            if (!preg_match("/^[a-zA-Z0-9-_]+$/", $this->cookieName)) {
                throw new InvalidConfigException('Invalid cookieName');
            }
            $this->cookie = [
                'name' => $this->cookieName,
                'value' => [$this->cookieName, $this->cookieValue],
                'options' => $this->cookieOptions,
            ];
        }
    }
600372
public function init(): void
    {
        parent::init();

        if ($this->name === null || !\is_string($this->name) || $this->name === '') {
            throw new InvalidConfigException('Formatter name must be defined');
        }
        if ($this->path === null) {
            throw new InvalidConfigException('File path property must be defined and be not empty');
        }
        foreach ($this->formatAdapterArray as $i => $formatAdapter) {
            $this->formatAdapterArray[$i] = Container::createObject($formatAdapter);

            if (!($this->formatAdapterArray[$i] instanceof IFormatAdapter)) {
                throw new InvalidConfigException(sprintf('Format adapter must be instance of %s.', IFormatAdapter::class));
            }
        }
    }
908837
public function init()
    {
        parent::init();

        if ($this->connectorRoute === null) {
            throw new InvalidConfigException('Connector route must be specified.');
        }

        $this->settings['url'] = Url::toRoute($this->connectorRoute);

        if (!isset($this->settings['lang'])) {
            $this->settings['lang'] = Yii::$app->language;
        } elseif ($this->settings['lang'] === false) {
            unset($this->settings['lang']);
        }

        $this->settings['customData'] = [
            Yii::$app->request->csrfParam => Yii::$app->request->csrfToken,
        ];
    }
915141
public function init()
    {
        NestableAsset::register($this->getView());
        if ($this->dataProvider !== null) {
            $this->prepareItems();
        }
        if ($this->items === null) {
            throw new InvalidConfigException('The "dataProvider" property or "items" property must be set at least one.');
        }
        Html::addCssClass($this->options, $this->rootClass);

        if (!ArrayHelper::keyExists('id', $this->options)) {
            $this->options['id'] = uniqid('w_');
        }

    }
714283
protected function initConfig() {
		$config = Xml::read($this->file);

		if ($config->getName() !== 'container') {
			throw new InvalidConfig('Root element of a config must be a "container"', null, null, $config);
		}

		$this->override = ($config->override === 'true');
		
		$this->includes     = [];
		$this->parameters   = new stdClass();
		$this->services     = new stdClass();
		$this->initializers = new stdClass();
		
		foreach ($config->getContent() as $element) {
			$name = $element->getName();
			
			if ($name === 'includes') {
				$this->includes = array_merge($this->includes, $this->processIncludes($element));
				continue;
			}
			
			if ($name === 'parameters') {
				$this->parameters = Std::objectMerge($this->parameters, $this->processParameters($element));
				continue;
			}
			
			if ($name === 'services') {
				$this->services = Std::objectMerge($this->services, $this->processServices($element));
				continue;
			}
			
			if ($name === 'initializers') {
				$this->initializers = Std::objectMerge($this->initializers, $this->processInitializers($element));
				continue;
			}
			
			throw new InvalidConfig('Unknown element "' . $element->getName() . '" in container', null, null, $element->getName());
		}
	}
30943
public function init()
    {
        if ($this->model === null) {
            throw new InvalidConfigException('Please specify the "model" property.');
        }

        $this->dataProvider = new ArrayDataProvider(['allModels' => [$this->model]]);
        parent::init();
    }
959649
public function init(): void
    {
        if ($this->identityClass === null) {
            throw new InvalidConfigException('User::identityClass must be set.');
        }
        if ($this->enableAutoLogin && !isset($this->identityCookie['name'])) {
            throw new InvalidConfigException('User::identityCookie must contain the "name" element.');
        }
    }
644887
protected function getConfigs()
    {
    	if (!$configs = $this->container->getParameter($this->getRequest()->get('config_identifier', 'none'))){
            throw new \InvalidArgumentException('Configs does no exist!');
    	}
    	
    	return $configs;
    }
442638
public function init()
	{
		parent::init();

		if (empty($this->statusAttribute)) {
			throw new InvalidConfigException('The "statusAttribute" configuration for the Behavior is required.');
		}

		// init source
		
		if (empty($this->source)) {
			throw new InvalidConfigException('The "source" configuration for the Behavior can\'t be empty.');
		} elseif (  ! Yii::$app->has($this->source)) {
			Yii::$app->set($this->source, ['class'=> self::DEFAULT_SOURCE_CLASS]);
		}
		$this->_wfSource = Yii::$app->get($this->source);

		// init Event Sequence
		
		if ( $this->eventSequence == null) {
			$this->_eventSequence = null;
		} elseif ( is_string($this->eventSequence)) {
			if (  ! Yii::$app->has($this->eventSequence)) {
				Yii::$app->set($this->eventSequence, ['class'=> self::DEFAULT_EVENT_SEQUENCE_CLASS]);
			}
			$this->_eventSequence = Yii::$app->get($this->eventSequence);
		} else {
			throw new InvalidConfigException('Invalid "eventSequence" value.');
		}
	}
666948
protected function collect()
    {
        $result = [];

        foreach ($this->_module->collection as $c) {
            if (class_exists($c)) {
                /** @var \rbacc\components\ConfigBase $config */
                $config = Yii::createObject($c);
                $result[] = $config->getData();
            } elseif (file_exists(Yii::getAlias($c))) {
                $result[] = require Yii::getAlias($c);
            } else {
                throw new InvalidConfigException('Class ' . $c . ' does not exist!');
            }
        }

        return $result;
    }
515819
public function init()
    {
        if (is_string($this->config)) {
            throw new InvalidConfigException('"config" must be of type array.');
        }
        $this->assets = array(
            'js' => YII_DEBUG ? 'foundation/foundation.alerts.js' : 'foundation.min.js'
        );

        if (!isset($this->config)) {
            $this->config = array(
                Enum::COLOR_REGULAR   => array(),
                Enum::COLOR_ALERT     => array(),
                Enum::COLOR_SECONDARY => array(),
                Enum::COLOR_SUCCESS   => array(),
            );
        }
        $this->htmlOptions = ArrayHelper::defaultValue('id', $this->getId(), $this->htmlOptions);
        parent::init();
    }