Bootstrap method to be called during application bootstrap stage.
@param Application $app the application currently running
973872
public function bootstrap($app)
    {
        $i18n = \Yii::$app->i18n;
        if (
            !isset($i18n->translations[Constants::MSG_CATEGORY_NAME]) &&
            !isset($i18n->translations['ekstazi.*'])
        ) {
            $i18n->translations[Constants::MSG_CATEGORY_NAME] = [
                'class'          => 'yii\i18n\PhpMessageSource',
                'sourceLanguage' => 'en-US',
                'basePath'       => '@ekstazi/crud/messages',
                'fileMap'        => [
                    'ekstazi/crud' => 'crud.php'
                ]
            ];
        }
        $di = \Yii::$container;
        $di->set('ekstazi\crud\actions\CreateAction', [
            'redirectTo' => RedirectTo::byPk(['view']),
        ]);
        $di->set('ekstazi\crud\actions\UpdateAction', [
            'redirectTo' => RedirectTo::byPk(['view']),
        ]);
    }
172566
public function boot(Application $app)
    {
        // Register Monolog error handler for fatal errors here because Symfony's handler overrides it
        $monologErrorHandler = new MonologErrorHandler($app['log']);

        $monologErrorHandler->registerErrorHandler();
        $monologErrorHandler->registerFatalHandler();
    }
1147240
public function bootstrap(Application $app)
    {
        try
        {
            Dotenv::makeMutable();
            Dotenv::load($app->environmentPath(), $app->environmentFile());
            Dotenv::makeImmutable();
        } catch (InvalidArgumentException $e)
        {
            //
        }

        $app->detectEnvironment(
            function ()
            {
                return env('APP_ENV', 'production');
            }
        );
    }
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);
    }
341644
public function boot(Application $application, InputInterface $input, $output)
    {
        if (true === $this->booted) {
            return;
        }

        $this->application = $application;
        $this->input       = $input;
        $this->output      = $output;

        $this->initializeContainer();
        $this->booted = true;
    }
940681
public function bootstrap(Container $app)
    {
        Facade::clearResolvedInstances();
        
        Facade::setFacadeApplication($app);
        
        AliasLoader::getInstance($app->make('config')->get('app.aliases'))->register();
        AliasLoader::getInstance($app->make('config')->get('app.theme.aliases', []))->register();
    }
1303205
public function boot(Application $app)
    {
        $app->on(KernelEvents::EXCEPTION, function (GetResponseForExceptionEvent $event) {
            $e = $event->getException();
            if ($e instanceof MethodNotAllowedHttpException && $e->getHeaders()["Allow"] === "OPTIONS") {
                $event->setException(new NotFoundHttpException("No route found for \"{$event->getRequest()->getMethod()} {$event->getRequest()->getPathInfo()}\""));
            }
        });
    }
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',
                ]
            ]);
        }
    }
1275876
public function boot(Application $app)
	{
		$assets = $this;
		$app->before(function(Request $request) use($app, $assets){
			$baseUrl = rtrim($request->getScheme().'://'.$request->getHttpHost().$request->getBasePath()).'/';
			$assets->setCoreUrl($baseUrl);
			$assets->setOption('baseUrl', $baseUrl);
			$assets->setOption('jsPosition',$assets::ON_BODY);
			return $assets;
		});

		// Registering preloaded options
		$options = isset($app['assets.options'])?$app['assets.options']:array();
		if(!empty($options))
			array_walk($options, function($optionValue, $optionName) use($assets){
				$assets->setOption($optionName, $optionValue);
			});	

		// Registering preloaded javascript files
		$js = isset($app['assets.js'])?$app['assets.js']:array();
		if(!empty($js))
			array_walk($js, function($value) use($assets){
				$assets->registerJs($value);
			});

		// Registering preloaded css files
		$css = isset($app['assets.css'])?$app['assets.css']:array();
		if(!empty($css))
			array_walk($css, function($value) use($assets){
				$assets->registerCss($value);
			});

		$app->after(function(Request $request, Response $response) use($app, $assets){
			// print_r($response->headers->get('content_type'));
			if($response->headers->get('content_type')!='application/json')
			{
				$content = $response->getContent();
				$assets->renderAssets($content);
				$response->setContent($content);
			}
			return $response;
		});
	}
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);
    }
1347826
public function run(Application $app)
    {
        $this->trigger(self::EVENT_BEFORE_RUN);
        $response = call_user_func_array($this->callback, array_merge($this->parameters, [$app]));
        parent::callAfterCallbacks($app);
        $this->trigger(self::EVENT_AFTER_RUN);
        return $response;
    }
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;
    }
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'
            );
        });
    }
809788
public function boot(Application $app, array $addons)
    {
        foreach ($addons as $addon) {
            $this->registerPackage($app, $addon);
        }
    }
783894
public function boot(Application $app)
    {
        $this->strategies = $app['cors.strategies'];
        foreach ($this->strategies as &$strategy) {
            if (is_array($strategy)) {
                $strategy = new CrossOriginResourceSharingStrategy($strategy);
            }
            elseif (!$strategy instanceof CrossOriginResourceSharingStrategy) {
                throw new \InvalidArgumentException(
                    static::class . " must be constructed with array of " . CrossOriginResourceSharingStrategy::class
                );
            }
        }
        
        $app->before([$this, 'onPreRouting'], SilexKernel::BEFORE_PRIORITY_ROUTING + 1);
        $app->before([$this, 'onPostRouting'], SilexKernel::BEFORE_PRIORITY_CORS_PREFLIGHT);
        $app->after([$this, 'onResponse'], Application::LATE_EVENT);
        //$app->error([$this, 'onMethodNotAllowed'], Application::EARLY_EVENT);
        $app->error([$this, 'onMethodNotAllowedHttp'], Application::EARLY_EVENT);
    }
449935
public function bootstrap(Application $app)
	{
		$this->configureHandlers($app, $this->registerLogger($app));

		// Next, we will bind a Closure that resolves the PSR logger implementation
		// as this will grant us the ability to be interoperable with many other
		// libraries which are able to utilize the PSR standardized interface.
		$app->bind('Psr\Log\LoggerInterface', function($app)
		{
			return $app['log']->getMonolog();
		});
	}
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();
        });
    }