Bootstrap the given application.

@param  \Illuminate\Contracts\Foundation\Application  $app
@return void
356637
public function bootstrap(Container $app)
    {
        foreach ($app->make('config')->get('app.services') as $key => $services) {
            foreach ((array) $services as $service) {
                $app->alias($key, $service);
            }
        }
        
        foreach ($app->make('config')->get('app.theme.services', []) as $key => $services) {
            foreach ((array) $services as $service) {
                $app->alias($key, $service);
            }
        }
    }
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',
            ];
        }
    }
659333
public function boot()
    {
        $this->publishes([
            __DIR__.'/../config/media.php' => config_path('media.php')
        ], 'config');

        $this->publishes([
            __DIR__ . '/../migrations' => $this->app->databasePath() . '/migrations'
        ], 'migrations');
    }
1076142
public function boot($app)
    {
        if (!$this->isBooted) {
            $this->loadViews();
            $this->loadTranslations();
            $this->isBooted = true;
        }

        return $this;
    }
210028
public function bootstrap(Application $app)
    {
        if ($app->configurationIsCached()) {
            return;
        }

        $this->checkForSpecificEnvironmentFile($app);

        try {
            $this->createDotenv($app)->safeLoad();
        } catch (InvalidFileException $e) {
            $this->writeErrorAndDie($e);
        }
    }
632806
public function boot()
    {
        // Configuration
        $this->publishes([
            __DIR__ . '/../config/membership.php' => config_path('membership.php'),
        ], 'config');

        // Migrations
        $this->loadMigrationsFrom(__DIR__ . '/../migrations');
        $this->publishes([
            __DIR__ . '/../migrations/' => database_path('migrations')
        ], 'migrations');
    }
804810
public function boot(Container $app)
    {
        $app->afterResolving(function (BladeCompiler $compiler, $app) {

            $this->allowHighlightTag($compiler);

        });
    }
961811
protected function bootstrap(): void
	{
		(function($app, $container): void
		{
			include $this->applicationPath . '/bootstrap.php';
		})($this, $this->container);
	}
502655
public function boot(Application $app)
    {
        $app['twigwrapper'] = new TwigWrapper($app[$this->twigIdentifier], $this->postProcessors);
    }
610155
public function bootstrap(Application $app)
    {
        if ($app->configurationIsCached()) {
            return;
        }

        $this->checkForSpecificEnvironmentFile($app);
        try {
            (new Dotenv($app->environmentPath(), $app->environmentFile()))->load();
        } catch (InvalidPathException $e) {
            //
        }
    }
875230
public function bootstrap($app)
    {
        $app->registerMigrationAlias('@canis/broadcaster/migrations');
        
        $app->setModule('broadcaster', ['class' => Module::className()]);
        $module = $app->getModule('broadcaster');
        $module->registerHandlers($this->initialHandlers);
        $module->registerEventTypes($this->initialEventTypes);

        Event::on(Daemon::className(), Daemon::EVENT_REGISTER_DAEMONS, [$this, 'registerDaemon']);
        
        // Event::on(Cron::className(), Cron::EVENT_WEEKLY, [$module, 'weeklyEmailDigest']);
        // Event::on(Cron::className(), Cron::EVENT_MORNING, [$module, 'dailyEmailDigest']);
    }
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'));
            });
        }
    }
1084245
public function boot()
    {
        $this->publishes([
            realpath(__DIR__.'/../config/follow.php') => config_path('follow.php'),
        ], 'config');

        $this->publishes([
            realpath(__DIR__.'/../database/migrations') => database_path('migrations'),
        ], 'migrations');
    }
1026610
public function boot()
    {
        // Check the existence of the cache.
        if (config('app.key') and ! cache()->has('roles') and env('DB_DATABASE')) {
            (new Privilege)->roles();
        }

        $this->registerPolicies();

        // Global policies.
        $this->registerGlobalPolicies();

        // Front-end policies.
        $this->registerCommentsPolicies();

        // Back-end policies.
        $this->registerDashboardPolicies();
        $this->registerPrivilegesPolicies();
        $this->registerThemesPolicies();
        $this->registerXFieldsPolicies();

        $this->registerAdminSettingsPolicies();

        $this->registerAdminArticles();
        $this->registerAdminCategories();
        $this->registerAdminComments();
        $this->registerAdminFiles();
        $this->registerAdminNotes();
        $this->registerAdminUsers();
    }
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']);

    }
627938
public function bootstrap(): void
    {
        foreach ($this->bootstrap as $mixed) {
            $component = null;
            if ($mixed instanceof \Closure) {
                $this->debug('Bootstrap with Closure', __METHOD__);
                if (empty($component = call_user_func($mixed, $this))) {
                    continue;
                }
            } elseif (is_string($mixed)) {
                if ($this->has($mixed)) {
                    $component = $this->get($mixed);
                } elseif ($this->hasModule($mixed)) {
                    $component = $this->getModule($mixed);
                } elseif (strpos($mixed, '\\') === false) {
                    throw new InvalidConfigException("Unknown bootstrapping component ID: $mixed");
                }
            }

            if (!isset($component)) {
                $component = $this->createObject($mixed);
            }

            if ($component instanceof BootstrapInterface) {
                $this->debug('Bootstrap with ' . get_class($component) . '::bootstrap()', __METHOD__);
                $component->bootstrap($this);
            } else {
                $this->debug('Bootstrap with ' . get_class($component), __METHOD__);
            }
        }
    }
809788
public function boot(Application $app, array $addons)
    {
        foreach ($addons as $addon) {
            $this->registerPackage($app, $addon);
        }
    }