Bootstrap for the whole application in Yii 2?

Set module settings "on site", there is a component, add it to bootstrap components in config

For example I have item "is the site?"
I need to check the setting value, and if the site is off -> catchAll add in urlManager.

The question of where and how to make a Bootstrap for the whole application in yii ?
So it was available all the components and I could do something, before transferring control to the controller?

For example to check the value settings and "disable" the site.
April 3rd 20 at 18:39
1 answer
April 3rd 20 at 18:41
Config web.php:

In the filtering test necessary conditions and
Yii::$app->catchAll = [self::MAINTENANCE_MODE_ROUTE];
if you need
Good afternoon.
Take screenshot-s and paste the code human. - donato_Walter commented on April 3rd 20 at 18:44

Find more questions by tags Yii