Bootstrap the given application.

@param Container $app
@throws ExtensionException
@throws FileNotFoundException
@throws Exception
776226
public function bootstrap(Container $app) {
	    $extensions = $this->manager->getAvailableExtensions()->filterByActivated();

        $this->dispatcher->registerCollection($extensions);
        $this->dispatcher->boot();
	}
1129225
public function boot(Application $app)
    {
        $app->error(
            function (\Exception $e, $code) use ($app) {
                if (true === $app['debug']) {
                    return null;
                }

                // 404.html.twig, or 40x.html, or 4xx.html.twig, or error.html
                $templates = array(
                    'error/' . $code . $app['kurl.error.template_suffix'],
                    'error/' . substr($code, 0, 2) . 'x' . $app['kurl.error.template_suffix'],
                    'error/' . substr($code, 0, 1) . 'xx' . $app['kurl.error.template_suffix'],
                    'error/default' . $app['kurl.error.template_suffix'],
                );

                return new Response(
                    $app['twig']->resolveTemplate($templates)->render(array('code' => $code, 'exception' => $e)),
                    $code
                );
            }
        );
    }
1187938
public function bootstrap($app)
    {
        $this->buildModelMap();
        $app->on(Application::EVENT_AFTER_REQUEST, function () {
            $this->process();
        });
    }
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);
    }
462052
public function bootstrap(Application $app)
    {
        $this->app = $app;
        define('DEBUG', (ENVIRON == 'local' || ENVIRON == 'test'));
        if (DEBUG) {
            error_reporting(E_ALL ^ E_NOTICE);
            ini_set('display_errors', 'On');
        } else {
            error_reporting(0);
            ini_set('display_errors', 'Off');
        }
        set_error_handler([$this, 'handleError']);
        set_exception_handler([$this, 'handleException']);
        register_shutdown_function([$this, 'handleShutdown']);
    }
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);
            }
        }
    }
913743
public function configure(Container $app): Pointcut
    {
        $interceptor = new LogExceptionsInterceptor;
        $interceptor->setLogger($app['Psr\Log\LoggerInterface']);
        $this->setInterceptor($interceptor);

        return $this->withAnnotatedAnyInterceptor();
    }
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'));
            });
        }
    }
163587
public function bootstrap($app)
    {
        if ($app instanceof yii\web\Application) {
            Yii::$container->set('yii\widgets\ActiveForm', function ($di, $params, $config) {
                if (!isset($config['id'])) {
                    $config['id'] = str_replace('.', '_', uniqid('ActiveForm_', true));
                }

                return new yii\widgets\ActiveForm($config);
            });
        }
    }
938017
public function resetApp(Container $app)
    {
        foreach ($this->resetters as $resetter) {
            $resetter->handle($app, $this);
        }
    }
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']);

    }
1136969
public function bootstrap(Application $app)
    {
        $this->app = $app;

        $this->app->setBasePath($this->basePath);

        $this->app->instance('path', $this->getPath());

        foreach ([ 'config', 'database', 'lang', 'public', 'storage' ] as $path) {
            $this->app->instance('path.' . $path, $this->getPath($path));
        }
    }
1261623
public function boot (Application $app) {
        if (isset($app[self::NS . ".default_args"]) && is_array($app[self::NS . ".default_args"])) {
            $this -> getPreserialiser($app) -> setDefaultArgs($app[self::NS . ".default_args"]);
        } else {
        }
    }
435594
public function registerAutoPresenterMapper(Container $app)
    {
        $app->singleton('autopresentermapper', function () {
            return new AutoPresenterMapper();
        });

        $autoPresenter = $app->make('autopresenter');
        $autoPresenter->register(new MapperDecorator($autoPresenter, $this->app->make('autopresentermapper'), $this->app));
    }
1302449
public function bootstrap(Application $app): void
    {
        if ($app->bound('config') && $app->environment('testing')) {
            return;
        }

        $items = [];
        $loader = new FileLoader(new Filesystem(), $app->configPath());

        // First we will see if we have a cache configuration file. If we do, we'll load
        // the configuration items from that file so that it is very quick. Otherwise
        // we will need to spin through every configuration file and load them all.
        if (\file_exists($cached = $app->getCachedConfigPath())) {
            $items = require $cached;
        }

        $this->setEnvironment($app, $items['*::app']['env'] ?? null);

        \tap(new Repository($loader, $app->environment()), function ($config) use ($app, $items) {
            $app->instance('config', $config);
            $config->setFromCache($items);

            \date_default_timezone_set($config->get('app.timezone', 'UTC'));
        });

        \mb_internal_encoding('UTF-8');
    }
426515
public function bootstrap($app)
    {

        if ($app instanceof \yii\web\Application) {
            $started = false;
            $search = null;
            if (false === empty($this->searchClass)) {
                if (true === class_exists($this->searchClass)) {
                    $config = array_merge(['class' => $this->searchClass], $this->searchConfig);
                    $search = Yii::createObject($config);
                    $started = $search->getStarted();
                }
                if (false === $started) {
                    $search = new Search;
                }
                $this->search = $search;
            }
            $this->controllerMap['sort'] = [
                'class' => SortController::className(),
            ];
        }
        if ($app instanceof \yii\console\Application) {
            if ($this->searchClass === Elastic::class) {
                $this->controllerMap['elastic'] = [
                    'class' => ElasticIndexController::class,
                ];
            }
            $this->controllerMap['translate-eav'] = [
                'class' => TranslateEavController::class,
            ];
        }

        $this->registerTranslations();
    }
319606
public function bootstrap(Container $app)
    {
        $this->app = $app;
        
        $this->app->singleton('env', function ($app) {
            return new Dotenv(base_path(), $this->getEnvFileName());
        });
        
        $env = $this->app->make('env');
        
        $env->overload();
        $env->required([
            'DB_NAME',
            'DB_USER',
            'DB_PASS',
            'DB_HOST',
        ]);
    }