Resolve application bootstrapper.

@param  \Illuminate\Foundation\Application  $app

@return void
9792
protected function resolveApplicationBootstrappers($app)
    {
        $app->make('Illuminate\Foundation\Bootstrap\HandleExceptions')->bootstrap($app);
        $app->make('Illuminate\Foundation\Bootstrap\RegisterFacades')->bootstrap($app);
        $app->make('Illuminate\Foundation\Bootstrap\SetRequestForConsole')->bootstrap($app);
        $app->make('Illuminate\Foundation\Bootstrap\RegisterProviders')->bootstrap($app);

        $this->getEnvironmentSetUp($app);

        $app->make('Illuminate\Foundation\Bootstrap\BootProviders')->bootstrap($app);

        foreach ($this->getPackageBootstrappers($app) as $bootstrap) {
            $app->make($bootstrap)->bootstrap($app);
        }

        $app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();

        $app['router']->getRoutes()->refreshNameLookups();

        $app->resolving('url', function ($url, $app) {
            $app['router']->getRoutes()->refreshNameLookups();
        });
    }
234981
public function bootstrap(Application $app)
	{
		try
		{
			Dotenv::load($app->basePath(), $app->environmentFile());
		}
		catch (InvalidArgumentException $e)
		{
			//
		}

		$app->detectEnvironment(function()
		{
			return env('APP_ENV', 'production');
		});
	}
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');
    }
270496
public function bootstrap($app)
    {

        Event::on(ProductController::className(),
            ProductController::EVENT_AFTER_CREATE_PRODUCT, [$this, 'invalidateCache']);
        Event::on(ProductController::className(),
            ProductController::EVENT_AFTER_EDIT_PRODUCT, [$this, 'invalidateCache']);
        Event::on(ProductController::className(),
            ProductController::EVENT_AFTER_DELETE_PRODUCT, [$this, 'invalidateCache']);

        Event::on(CategoryController::className(),
            CategoryController::EVENT_AFTER_CREATE_CATEGORY, [$this, 'invalidateCache']);
        Event::on(CategoryController::className(),
            CategoryController::EVENT_AFTER_EDIT_CATEGORY, [$this, 'invalidateCache']);
        Event::on(CategoryController::className(),
            CategoryController::EVENT_AFTER_DELETE_CATEGORY, [$this, 'invalidateCache']);

        Event::on(Category::className(),
            Category::EVENT_AFTER_DELETE, [$this, 'invalidateCache']);
        Event::on(Category::className(),
            Category::EVENT_AFTER_INSERT, [$this, 'invalidateCache']);
        Event::on(Category::className(),
            Category::EVENT_AFTER_UPDATE, [$this, 'invalidateCache']);

        Event::on(Product::className(),
            Product::EVENT_AFTER_DELETE, [$this, 'invalidateCache']);
        Event::on(Product::className(),
            Product::EVENT_AFTER_INSERT, [$this, 'invalidateCache']);
        Event::on(Product::className(),
            Product::EVENT_AFTER_UPDATE, [$this, 'invalidateCache']);

        Event::on(Vendor::className(),
            Vendor::EVENT_AFTER_DELETE, [$this, 'invalidateCache']);
        Event::on(Vendor::className(),
            Vendor::EVENT_AFTER_INSERT, [$this, 'invalidateCache']);
        Event::on(Vendor::className(),
            Vendor::EVENT_AFTER_UPDATE, [$this, 'invalidateCache']);

        Event::on(Vendor::className(),
            Vendor::EVENT_AFTER_DELETE, [$this, 'invalidateCache']);
        Event::on(Vendor::className(),
            Vendor::EVENT_AFTER_INSERT, [$this, 'invalidateCache']);
        Event::on(Vendor::className(),
            Vendor::EVENT_AFTER_UPDATE, [$this, 'invalidateCache']);

        Event::on(ProductAvailability::className(),
            ProductAvailability::EVENT_AFTER_DELETE, [$this, 'invalidateCache']);
        Event::on(ProductAvailability::className(),
            ProductAvailability::EVENT_AFTER_INSERT, [$this, 'invalidateCache']);
        Event::on(ProductAvailability::className(),
            ProductAvailability::EVENT_AFTER_UPDATE, [$this, 'invalidateCache']);

        Event::on(ShopAttribute::className(),
            ShopAttribute::EVENT_AFTER_DELETE, [$this, 'invalidateCache']);
        Event::on(ShopAttribute::className(),
            ShopAttribute::EVENT_AFTER_INSERT, [$this, 'invalidateCache']);
        Event::on(ShopAttribute::className(),
            ShopAttribute::EVENT_AFTER_UPDATE, [$this, 'invalidateCache']);

        Event::on(ShopAttributeValue::className(),
            ShopAttributeValue::EVENT_AFTER_DELETE, [$this, 'invalidateCache']);
        Event::on(ShopAttributeValue::className(),
            ShopAttributeValue::EVENT_AFTER_INSERT, [$this, 'invalidateCache']);
        Event::on(ShopAttributeValue::className(),
            ShopAttributeValue::EVENT_AFTER_UPDATE, [$this, 'invalidateCache']);

        Event::on(ProductCountry::className(),
            ProductCountry::EVENT_BEFORE_DELETE, [$this, 'invalidateCache']);
        Event::on(ProductCountry::className(),
            ProductCountry::EVENT_BEFORE_INSERT, [$this, 'invalidateCache']);
        Event::on(ProductCountry::className(),
            ProductCountry::EVENT_BEFORE_UPDATE, [$this, 'invalidateCache']);

        Event::on(FavoriteProduct::className(),
            FavoriteProduct::EVENT_AFTER_DELETE, [$this, 'invalidateCache']);
        Event::on(FavoriteProduct::className(),
            FavoriteProduct::EVENT_AFTER_INSERT, [$this, 'invalidateCache']);
        Event::on(FavoriteProduct::className(),
            FavoriteProduct::EVENT_AFTER_UPDATE, [$this, 'invalidateCache']);

        Event::on(CartComponent::className(),
            CartComponent::EVENT_AFTER_CLEAR, [$this, 'invalidateCache']);
        Event::on(CartComponent::className(),
            CartComponent::EVENT_AFTER_ADD_PRODUCT, [$this, 'invalidateCache']);
        Event::on(CartComponent::className(),
            CartComponent::EVENT_AFTER_REMOVE_PRODUCT, [$this, 'invalidateCache']);
        Event::on(CartComponent::className(),
            CartComponent::EVENT_BEFORE_GET_ORDER, [$this, 'invalidateCache']);
        Event::on(CartComponent::className(),
            CartComponent::EVENT_BEFORE_GET_ORDER_FROM_DB, [$this, 'invalidateCache']);

    }
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'
            );
        });
    }
434432
protected function bootstrap()
    {
        $this->app->bootstrap();

        if ($this->app instanceof PluginApplicationInterface) {
            $this->app->pluginBootstrap();
        }
    }
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;
    }
1146027
public function register(Application $app)
    {
        $this->loadProviders();

        foreach ($this->controllerProviders as $class => $values) {
            $app->register(new $class, $values);
        }
    }
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(),
					]);
				}
			});
		}
    }
920014
public function bootModules(Application $app)
    {
        foreach ($this->getRegisteredModules() as $module) {
            $module->boot($app);
        }

        return $this;
    }
602524
public function boot(Application $app)
    {
        foreach ($app['alchemy_queues.queues'] as $name => $configuration) {
            /** @var MessageQueueRegistry $targetRegistry */
            $targetRegistry = $app['alchemy_queues.registry'];

            if (isset($configuration['registry'])) {
                $targetRegistry = $app[$configuration['registry']];
            }

            $targetRegistry->bindConfiguration($name, $configuration);
        }
    }
856265
public function bootstrap($app)
    {
        /** @var Module $module */
        /** @var \yii\db\ActiveRecord $modelName */
        if ($app->hasModule('oauth2') && ($module = $app->getModule('oauth2')) instanceof Module) {
            if ($app instanceof \yii\console\Application) {
                $app->controllerMap[$module->id] = [
                    'class' => Oauth2Controller::className(),
                ];
            }
            /**
             * 注册语言包
             */
            if (!isset($app->get('i18n')->translations['oauth2*'])) {
                $app->get('i18n')->translations['oauth2*'] = [
                    'class' => PhpMessageSource::className(),
                    'sourceLanguage' => 'en-US',
                    'basePath' => __DIR__ . '/messages',
                ];
            }
        }
    }
474310
public function bootstrap(Application $app)
    {
        if ($app->make('antares.extension.mode')->check()) {
            $app->make('antares.messages')->extend(function (MessageBag $messages) {
                $messages->add('info', trans('antares/foundation::response.safe-mode'));
            });
        }
    }
257753
public function bootstrap($app)
    {
        if ($app instanceof \yuncms\admin\Application) {
//            Yii::$container->set('yii\web\User', [
//                'enableAutoLogin' => true,
//                'loginUrl' => ['/admin/security/login'],
//                'identityClass' => 'yuncms\admin\models\Admin',
//                'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
//            ]);
            //$app->set('authManager', [
            //    'class' => 'yuncms\admin\components\RbacManager',
            //    'cache' => 'cache',
            //]);

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

            //附加权限验证行为
//            $app->attachBehavior('access', Yii::createObject([
//                'class' => 'yuncms\admin\components\AccessControl'
//            ]));

//            $app->urlManager->addRules([
//                'login' => '/site/login',
//                'logout' => '/site/logout',
//                'error' => '/site/error',
//            ], false);
        }

        /**
         * 注册语言包
         */
        if (!isset($app->get('i18n')->translations['admin*'])) {
            $app->get('i18n')->translations['admin*'] = [
                'class' => PhpMessageSource::className(),
                'sourceLanguage' => 'en-US',
                'basePath' => __DIR__ . '/messages',
            ];
        }
    }
1251435
public function bootstrap(Application $app)
    {
        $this->setDefaultPermalinkStructure($app);

        $app['actions']->listen('init', function () use ($app) {
            $this->extractWordPressClasses($app);
            $this->bootstrapRoutes($app['router']);
        });

        $app['actions']->listen('admin_init', function () use ($app) {
            do_action('template_redirect');
            $app['wp_admin_response'] = $app[Kernel::class]->handle($request = Request::capture());
        });
    }
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;
    }
804810
public function boot(Container $app)
    {
        $app->afterResolving(function (BladeCompiler $compiler, $app) {

            $this->allowHighlightTag($compiler);

        });
    }