Bootstrap method to be called during application bootstrap stage.

@param Application $app the application currently running
426515
public function bootstrap($app)
    {

        if ($app instanceof \yii\web\Application) {
            $started = false;
            $search = null;
            if (false === empty($this->searchClass)) {
                if (true === class_exists($this->searchClass)) {
                    $config = array_merge(['class' => $this->searchClass], $this->searchConfig);
                    $search = Yii::createObject($config);
                    $started = $search->getStarted();
                }
                if (false === $started) {
                    $search = new Search;
                }
                $this->search = $search;
            }
            $this->controllerMap['sort'] = [
                'class' => SortController::className(),
            ];
        }
        if ($app instanceof \yii\console\Application) {
            if ($this->searchClass === Elastic::class) {
                $this->controllerMap['elastic'] = [
                    'class' => ElasticIndexController::class,
                ];
            }
            $this->controllerMap['translate-eav'] = [
                'class' => TranslateEavController::class,
            ];
        }

        $this->registerTranslations();
    }
1129225
public function boot(Application $app)
    {
        $app->error(
            function (\Exception $e, $code) use ($app) {
                if (true === $app['debug']) {
                    return null;
                }

                // 404.html.twig, or 40x.html, or 4xx.html.twig, or error.html
                $templates = array(
                    'error/' . $code . $app['kurl.error.template_suffix'],
                    'error/' . substr($code, 0, 2) . 'x' . $app['kurl.error.template_suffix'],
                    'error/' . substr($code, 0, 1) . 'xx' . $app['kurl.error.template_suffix'],
                    'error/default' . $app['kurl.error.template_suffix'],
                );

                return new Response(
                    $app['twig']->resolveTemplate($templates)->render(array('code' => $code, 'exception' => $e)),
                    $code
                );
            }
        );
    }
776226
public function bootstrap(Container $app) {
	    $extensions = $this->manager->getAvailableExtensions()->filterByActivated();

        $this->dispatcher->registerCollection($extensions);
        $this->dispatcher->boot();
	}
200833
protected function resolveApplicationConfiguration($app)
    {
        $app->make('Illuminate\Foundation\Bootstrap\LoadConfiguration')->bootstrap($app);

        \tap($this->getApplicationTimezone($app), function ($timezone) {
            ! \is_null($timezone) && \date_default_timezone_set($timezone);
        });

        $app['config']['app.aliases'] = $this->resolveApplicationAliases($app);
        $app['config']['app.providers'] = $this->resolveApplicationProviders($app);
    }
798662
public function bootstrap($app)
    {
        /** @var Module $module */
        /** @var \yii\db\ActiveRecord $modelName */
        if ($app->hasModule('system') && ($module = $app->getModule('system')) instanceof Module) {
            if ($app instanceof \yii\console\Application) {

            } else if (class_exists('\yuncms\admin\Application') && $app instanceof \yuncms\admin\Application) {

            } elseif ($module instanceof Module) {//前台判断放最后
                $app->urlManager->addRules([
                    'page' => 'system/page/view',
                ]);
                //注册Url管理
                $app->urlManager->addRules([
                    [
                        'class' => 'yuncms\system\components\SlugUrlRule',
                    ]
                ], true);
            }
        }
//        $app->set('settings', [
//            'class' => 'yuncms\system\components\Settings',
//        ]);

        /**
         * 注册语言包
         */
        if (!isset($app->get('i18n')->translations['system*'])) {
            $app->get('i18n')->translations['system*'] = [
                'class' => PhpMessageSource::className(),
                'sourceLanguage' => 'en-US',
                'basePath' => __DIR__ . '/messages',
            ];
        }
    }
804810
public function boot(Container $app)
    {
        $app->afterResolving(function (BladeCompiler $compiler, $app) {

            $this->allowHighlightTag($compiler);

        });
    }
1047552
protected function bootstrap($app): void
    {
        $app->bootstrapWith([
            \Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables::class,
            \CrCms\Microservice\Bootstrap\LoadConfiguration::class,
            \CrCms\Microservice\Bootstrap\HandleExceptions::class,
            \CrCms\Microservice\Bootstrap\RegisterFacades::class,
            //\Illuminate\Foundation\Bootstrap\SetRequestForConsole::class,
            \Illuminate\Foundation\Bootstrap\RegisterProviders::class,
            \Illuminate\Foundation\Bootstrap\BootProviders::class,
        ]);
    }
1146027
public function register(Application $app)
    {
        $this->loadProviders();

        foreach ($this->controllerProviders as $class => $values) {
            $app->register(new $class, $values);
        }
    }
163587
public function bootstrap($app)
    {
        if ($app instanceof yii\web\Application) {
            Yii::$container->set('yii\widgets\ActiveForm', function ($di, $params, $config) {
                if (!isset($config['id'])) {
                    $config['id'] = str_replace('.', '_', uniqid('ActiveForm_', true));
                }

                return new yii\widgets\ActiveForm($config);
            });
        }
    }
1076142
public function boot($app)
    {
        if (!$this->isBooted) {
            $this->loadViews();
            $this->loadTranslations();
            $this->isBooted = true;
        }

        return $this;
    }
753478
protected function startConfigPlugin($app)
    {
        $this->getVariables['config'] = function () {
            return $this->app->make('config');
        };

        $this->requiresPlugins(Resources::class, Paths::class);
        $this->onRegister('config', function ($app) {
            $this->registerConfigFiles();
        });
        $this->onBoot('config', function ($app) {
            $this->bootConfigFiles();
        });
    }
1261623
public function boot (Application $app) {
        if (isset($app[self::NS . ".default_args"]) && is_array($app[self::NS . ".default_args"])) {
            $this -> getPreserialiser($app) -> setDefaultArgs($app[self::NS . ".default_args"]);
        } else {
        }
    }
712603
public function run(Application $app)
    {
        $this->trigger(self::EVENT_BEFORE_RUN);
        if (count($this->_afterCallbacks) > 0) {
            $this->runCommandInForeground($app);
        } else {
            $this->runCommandInBackground($app);
        }
        $this->trigger(self::EVENT_AFTER_RUN);
    }
655536
public function bootstrap($app)
    {
        //附加权限验证行为
        $app->attachBehavior('access', Yii::createObject(BackendAccessControl::class));

        //设置前台URL
        $app->frontUrlManager->baseUrl = Yii::$app->settings->get('url', 'system');

        $manifestFile = Yii::getAlias('@vendor/yuncms/backend.php');
        if (is_file($manifestFile)) {
            $manifests = require($manifestFile);
            $app->setModules($manifests);
        }
    }
913545
public function bootstrap($app)
    {
        // add trace
        Yii::beginProfile('LUYA Boostrap process profiling', __METHOD__);
        
        // register luya core translation message source
        if (!isset($app->i18n->translations['luya'])) {
            $app->i18n->translations['luya'] = [
                'class' => 'yii\i18n\PhpMessageSource',
                'basePath' => '@luya/messages',
            ];
        }
        
        $this->extractModules($app);
        $this->beforeRun($app);
        $this->registerComponents($app);
        $this->run($app);
        
        // end trace
        Yii::trace('End of the LUYA bootstraping process', __METHOD__);
        Yii::endProfile('LUYA Boostrap process profiling');
    }
975802
public function boot(Container $app)
    {
        $toBoot = (array) $app['config']->get('bootstrap', []);

        foreach ($toBoot as $bootstrapClass) {
            $app->make($bootstrapClass)->boot($app);
        }
    }
1089834
public function boot(Application $app)
    {

        // Register our filters to use
        if (isset($app['assetic.filters']) && is_callable($app['assetic.filters'])) {
            $app['assetic.filters']($app['assetic.filter_manager']);
        }

        /**
         * Writes down all lazy asset manager and asset managers assets
         */
        $app->after(function () use ($app) {
            // Boot assetic
            $assetic = $app['assetic'];

            if (!isset($app['assetic.options']['auto_dump_assets']) ||
                !$app['assetic.options']['auto_dump_assets']) {
                return;
            }
            $helper = $app['assetic.dumper'];
            if (isset($app['twig'])) {
                $helper->addTwigAssets();
            }
            $helper->dumpAssets();
        });
    }