Bootstraps the application.

This method is called after all services are registered
and should be used for "dynamic" configuration (whenever
a service must be requested).

@param Application $app
502655
public function boot(Application $app)
    {
        $app['twigwrapper'] = new TwigWrapper($app[$this->twigIdentifier], $this->postProcessors);
    }
306997
public function bootstrap(Application $app)
    {
        AutoLoader::registerHandler($app->getAutoLoader());

        $app->getAutoLoader()->setCachePath(
            $app->storagePath() . DIRECTORY_SEPARATOR
            . 'cache' . DIRECTORY_SEPARATOR . "autoloader" . DIRECTORY_SEPARATOR
        );

        $app->setupAutoLoaderPaths();

//        if ($this->getStaging()->getStage()->inTesting()) {
        $app->getAutoLoader()->getClassMapLoader()->setRetry(true);
//        }
    }
1255963
public function boot(Application $app, ConfigContract &$appConfig)
    {
        // Setup test DB
        $appConfig->set('database.connections.' . $this->connection, $this->options);
        $appConfig->set('database.default', $this->connection);

        // Set database migration path EG: /mysite/database/
        $app->useDatabasePath($this->path);
    }
716684
public function boot(Application $app)
    {
        $config = $app['config'];
        if (isset($config['orm.subscribers'])) {
            $app->extend('db.event_manager', function($eventMgr) use($app, $config) {
                /** @var EventManager $eventMgr */
                foreach ($config['orm.subscribers'] as $class) {
                    if (isset($app[$class])) {
                        $eventMgr->addEventSubscriber($app[$class]);
                    } else {
                        $eventMgr->addEventSubscriber(new $class());
                    }
                }
                return $eventMgr;
            });
        }
    }
403208
public function bootstrap($app)
    {
        $app->on(Application::EVENT_BEFORE_REQUEST, function () {
            $this->retrieveInfo();
            $this->retrieveLanguageFromGeo();
        });
        $app->on(Application::EVENT_BEFORE_ACTION, function () {
            $this->retrieveCookieLanguage();
        });
        $this->registerTranslations();
    }
1092880
public function boot(Application $app)
    {
        if (!$this->registered) {
            throw new \RuntimeException('Can not boot extensions prior to completion of registration.');
        }
        if ($this->booted) {
            throw new \RuntimeException('Can not re-boot extensions.');
        }

        // Boot all extension loaders that are also service providers
        foreach ($this->extensions as $extension) {
            if ($extension->isEnabled() !== true) {
                continue;
            }
            foreach ($extension->getInnerExtension()->getServiceProviders() as $provider) {
                $provider->boot($app);
            }
        }
        $this->loaded = true;
        $this->booted = true;
    }
210028
public function bootstrap(Application $app)
    {
        if ($app->configurationIsCached()) {
            return;
        }

        $this->checkForSpecificEnvironmentFile($app);

        try {
            $this->createDotenv($app)->safeLoad();
        } catch (InvalidFileException $e) {
            $this->writeErrorAndDie($e);
        }
    }
463937
public function bootstrap($app)
    {

        $app->urlManager->addRules([
            $this->id . '/login' => '/user/security/login',
            // $this->id . '/logout' => '/user/security/logout',
            $this->id . '/users/<action:\w+>' => '/user/admin/<action>',
            $this->id . '/rbac/<controller:\w+>/<action:\w+>' => '/rbac/<controller>/<action>',
        ]);

        $app->getModule('user')->controllerMap['admin'] = [
            'class'  => 'dektrium\user\controllers\AdminController',
            'layout' => '@vendor/colibri-platform/admin/views/layouts/main.php'
        ];

        $app->getModule('rbac')->layout = '@vendor/colibri-platform/admin/views/layouts/main.php';

        if (ltrim($app->getRequest()->url, '/') == $this->id . '/login') {
            // Set the admin layout and override view to the login form
            $app->getModule('user')->controllerMap['security'] = [
                'class'  => 'dektrium\user\controllers\SecurityController',
                'layout' => '@vendor/colibri-platform/admin/views/layouts/login.php'
            ];

            $view = $app->getView();

            if (empty($view->theme)) {
                $view->theme = Yii::createObject('yii\base\Theme');
            }

            $view->theme->pathMap['@dektrium/user/views'] = __DIR__ . '/views/user';

            // Set the return url to the admin home
            $app->getUser()->setReturnUrl('/' . $this->id);
        }

        if ($app->getModule('treemanager', false) === null) {
            $app->setModule('treemanager', [
                'class' => '\kartik\tree\Module',

                // The list of asset bundles that would be unset when rendering the node detail form via ajax
                'unsetAjaxBundles' => [
                    'yii\web\YiiAsset',
                    'yii\web\JqueryAsset',
                    'yii\widgets\ActiveFormAsset',
                    'kartik\form\ActiveFormAsset',
                    'yii\validators\ValidationAsset',
                    'yii\bootstrap\BootstrapAsset',
                ]
            ]);
        }
    }
1336634
public function boot(Application $app)
    {
        if (!$app instanceof SilexKernel) {
            throw new \LogicException(static::class . " can only be used with " . SilexKernel::class);
        }
        
        $app->addControllerInjectedArg($this->cookieContainer);
        $app->after(
            function (/** @noinspection PhpUnusedParameterInspection */
                Request $request,
                Response $response) {
                foreach ($this->cookieContainer->getCookies() as $cookie) {
                    $response->headers->setCookie($cookie);
                }
            }
        );
    }
52430
protected function registerMapperInitializer(Application $app)
    {
        $initializer = function ($mapper, $app) {
            $mapper->setSqlFactory(new SqlFactory);
        };

        $app->initializer('Synapse\Mapper\AbstractMapper', $initializer);
    }
183372
public function bootstrap($app)
    {
		$models = Yii::$app->getModule('vote')->models;
		foreach ($models as $value) {
			$modelId = Rating::getModelIdByName($value);
			$modelName = Rating::getModelNameById($modelId);
			Event::on($modelName::className(), $modelName::EVENT_INIT, function ($event) {
			    if (null === $event->sender->getBehavior('rating')) {
					$event->sender->attachBehavior('rating', [
						'class' => RatingBehavior::className(),
					]);
				}
			});
		}
    }
95834
public function bootstrap(Application $app)
    {
        $this->app = $app;

        error_reporting(-1);

        set_error_handler([$this, 'handleError']);

        set_exception_handler([$this, 'handleException']);

        register_shutdown_function([$this, 'handleShutdown']);

        if (! $app->environment('testing')) {
            ini_set('display_errors', 'Off');
        }
    }
873198
public function register(Application $app)
    {
        $this->setup($app);
        $app
            ->offsetGet('console')
            ->getHelperSet()
            ->set(new ConnectionHelper($app->offsetGet('connection')), 'connection')
        ;
    }
804810
public function boot(Container $app)
    {
        $app->afterResolving(function (BladeCompiler $compiler, $app) {

            $this->allowHighlightTag($compiler);

        });
    }
1332794
public function boot(Application $app)
    {
        // Reference to $this, it's used for closure in anonymous function (PHP 5.3.x)
        $self = &$this;
        $app->get($app['swaggerui.path'], function(Request $request) use ($app) {
            return str_replace(
                array('{{swaggerui-root}}', '{{swagger-docs}}'),
                array($request->getBasePath() . $app['swaggerui.path'], $request->getBasePath() . $app['swaggerui.apiDocPath']),
                file_get_contents(__DIR__ . '/../../../../public/index.html')
            );
        });

        $app->get($app['swaggerui.path'] . '/{resource}', function($resource) use ($app) {
            $file = __DIR__ . '/../../../../public/' . $resource;
            if (is_file($file)) {
                return file_get_contents($file);
            }

            return '';
        });

        $app->get($app['swaggerui.path'] . '/lib/{resource}', function($resource) use ($app, $self) {
            return $self->getFile(
                __DIR__ . '/../../../../public/lib/' . $resource,
                'text/javascript'
            );
        });

        $app->get($app['swaggerui.path'] . '/css/{resource}', function($resource) use ($app, $self) {
            return $self->getFile(
                __DIR__ . '/../../../../public/css/' . $resource,
                'text/css'
            );
        });

        $app->get($app['swaggerui.path'] . '/images/{resource}', function($resource) use ($app, $self) {
            return $self->getFile(
                __DIR__ . '/../../../../public/images/' . $resource,
                'image/png'
            );
        });
    }
145991
public function bootstrap(Application $app)
    {
        if (app('antares.installed')) {
            //app('antares.license.response')->validate();
        }
        $this->setCurrentTheme($app);
        $this->setThemeResolver($app);
    }
730428
public function bootstrap(Application $app)
    {
        if ($app->make('orchestra.extension.status')->is('safe')) {
            Messages::extend(function (MessageBag $messages) {
                $messages->add('info', \trans('orchestra/foundation::response.safe-mode'));
            });
        }
    }