Application bootstrap wrapper.

Calls `bootstrap()` and `events()` if application implements `EventApplicationInterface`.
After the application is bootstrapped and events are attached, plugins are bootstrapped
and have their events attached.

@return void
434432
protected function bootstrap()
    {
        $this->app->bootstrap();

        if ($this->app instanceof PluginApplicationInterface) {
            $this->app->pluginBootstrap();
        }
    }
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();
    }
805790
private function bootstrap()
    {
        if (Configuration::read('bootstrap.enable') === true) {
            $applicationNamespace = Configuration::read('application.namespace');
            $bootstrapNamespace = $applicationNamespace . '\Bootstrap';
            if (!class_exists($bootstrapNamespace)) {
                throw new \Exception('Bootstrap "' . $bootstrapNamespace . '" doesn\' exist.');
                return false;
            }
            $bootstrap = new $bootstrapNamespace();
            if (!method_exists($bootstrap, 'initialize')) {
                $errorMessage = 'initialize() method isn\'t available in Bootstrap "' . $bootstrapNamespace . '".<br />';
                $errorMessage .= 'Your bootstrap may not extends \Pabana\Core\Bootstrap.';
                throw new \Exception($errorMessage);
                return false;
            }
            $bootstrap->initialize();
            return true;
        }
        return false;
    }
1336099
public function boot()
    {
        $this->loader->loadManifest();

        foreach ($this->extensions as $extension) {
            try {
                $this->eventDispatcher->dispatch(new Booted($extension));

                $name = $extension->getPackage()->getName();

                $this->eventDispatcher->dispatch('extension.started', [$name, []]);
                $this->eventDispatcher->dispatch('extension.started: {$name}', [[]]);
                $this->eventDispatcher->dispatch(new ComponentStarted($name));

                $this->eventDispatcher->dispatch('extension.booted', [$name, []]);
                $this->eventDispatcher->dispatch('extension.booted: {$name}', [[]]);
                $this->eventDispatcher->dispatch(new ComponentBooted($name));
            } catch (Exception $e) {
                throw $e;
            }
        }

        $this->eventDispatcher->dispatch(new BootedAll());
        $this->eventDispatcher->dispatch('antares.extension: booted');
        $this->eventDispatcher->dispatch(new ComponentsBooted());

        $this->loader->writeManifest();
        $this->booted = true;
    }
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');
        }
    }
194195
protected function bindEvents(): void
    {
        $userConfig = $this->app['config'][static::$abstract];

        $handler = new EventHandler($this->app->events, $userConfig);

        $handler->subscribe();

        $handler->subscribeQueueEvents($this->app->queue);

        if (isset($userConfig['send_default_pii']) && $userConfig['send_default_pii'] !== false) {
            $handler->subscribeAuthEvents();
        }
    }
1245774
public function bootstrap(PluginApplicationInterface $app)
    {
        if (!$app->getPlugins()->has('Recaptcha')) {
            $app->addPlugin('Recaptcha', ['path' => ROOT . DS . 'vendor' . DS . 'crabstudio' . DS . 'recaptcha' . DS]);
        }

        parent::bootstrap($app);
    }
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']);
    }
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']);

    }
390762
static private function bootstrap()
    {
        if (self::$expressions === null) {
            $configuration = new Configuration();
            $parameters = $configuration->getConfig();
            self::$expressions = $configuration->setUp($parameters);
        }
    }
882398
public function boot()
    {
        $this->app['events']->listen(LocaleUpdated::class, function ($locale) {
            $this->setLocale();
        });

        $this->setLocale();
    }
1232890
public function bootstrap(Application $app)
    {
        if (!app('antares.extension')->isActive('customfields')) {
            return false;
        }
        $app->make('antares.memory')->extend('registry', function ($app, $name) {
            $handler = new FormsRepository($name, [], $app);
            return new FormsProvider($handler);
        });
    }
947643
public function boot()
    {
        if ($this->booted) return;

        // Register service providers
        foreach ($this['config']->get('app.providers') as $provider) {
            $this->addProvider($provider);
        }

        // Register aliases
        AliasLoader::getInstance($this['config']->get('app.aliases'))->register();

        // Now run boot events on service providers
        array_walk($this->registered, function($p) {
            if (method_exists($p, 'boot')) $p->boot();
        });

        if (file_exists($bootstrap = $this->appPath."/bootstrap/{$this->mode}.php")) {
            require $bootstrap;
        }

        $this->booted = true;
    }
875017
public function init()
    {
        $this->invokeBeforeContainerCreatedHook();

        $this->container = $this->createContainer();

        StaticContainer::push($this->container);

        $this->validateEnvironment();

        $this->invokeEnvironmentBootstrappedHook();

        Piwik::postEvent('Environment.bootstrapped'); // this event should be removed eventually
    }
1187938
public function bootstrap($app)
    {
        $this->buildModelMap();
        $app->on(Application::EVENT_AFTER_REQUEST, function () {
            $this->process();
        });
    }
1158522
protected function bootstrap()
    {
        if ($this->framework === 'laravel') {
            $bootstrappers = $this->getBootstrappers();
            $this->app->bootstrapWith($bootstrappers);
        } else {
            // for Lumen 5.7
            // https://github.com/laravel/lumen-framework/commit/42cbc998375718b1a8a11883e033617024e57260#diff-c9248b3167fc44af085b81db2e292837
            if (method_exists($this->app, 'boot')) {
                $this->app->boot();
            }
            $this->app->withFacades();
        }

        $this->preResolveInstances();
    }
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,
        ]);
    }