This method will be invoked before the while() loop starts and can be used
to implement some bootstrap functionality.

@return void
199857
public function bootstrap()
    {

        // register the default autoloader
        require SERVER_AUTOLOADER;

        // synchronize the application instance and register the class loaders
        $application = $this->application;
        $application->registerClassLoaders();

        // register the applications annotation registries
        $application->registerAnnotationRegistries();

        // create a reference to the workers/messages
        $workers = $this->workers;
        $messages = $this->messages;
        $managerSettings = $this->managerSettings;

        // try to load the profile logger
        if ($this->profileLogger = $application->getInitialContext()->getLogger(LoggerUtils::PROFILE)) {
            $this->profileLogger->appendThreadContext(sprintf('message-queue-%s', $this->getName()));
        }

        // prepare the storages
        $jobsToExceute = array();

        // initialize the counter for the storages
        $counter = 0;

        // create a separate queue for each priority
        foreach (PriorityKeys::getAll() as $priorityKey) {
            // create the containers for the worker
            $jobsToExceute[$counter] = new GenericStackable();

            // initialize and start the queue worker
            $queueWorker = new QueueWorker();
            $queueWorker->injectMessages($messages);
            $queueWorker->injectApplication($application);
            $queueWorker->injectPriorityKey($priorityKey);
            $queueWorker->injectManagerSettings($managerSettings);

            // attach the storages
            $queueWorker->injectJobsToExecute($jobsToExceute[$counter]);

            // start the worker instance
            $queueWorker->start();

            // add the queue instance to the module
            $workers[$this->uniqueWorkerName($priorityKey)] = $queueWorker;

            // raise the counter
            $counter++;
        }
    }
240517
protected function execute()
    {
        $this->bootstrap();

        $output = $this->getOutput();
        $environment = $this->getOption('environment');
        $format = $this->getOption('format');

        if (null === $environment) {
            $environment = $this->getConfig()->getDefaultEnvironment();
            $output->writeln('<comment>warning</comment> no environment specified, defaulting to: ' . $environment);
        } else {
            $output->writeln('<info>using environment</info> ' . $environment);
        }
        if (null !== $format) {
            $output->writeln('<info>using format</info> ' . $format);
        }

        $output->writeln('<info>ordering by </info>' . $this->getConfig()->getVersionOrder() . " time");

        // print the status
        return $this->getManager()->printStatus($environment, $format);
    }
535619
protected function beforeStart()
    {
        // If no explicit request was given (via Enlighten::setRequest), create one based on the current PHP globals
        if (empty($this->request)) {
            $this->setRequest(Request::extractFromEnvironment());
        }

        $this->bootstrapRouter();
    }
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();
    }
1093913
public static function bootstrap() {
        global $PAGE;

        if (!isloggedin() || isguestuser()) {
            return;
        }

        if (in_array($PAGE->pagelayout, ['maintenance', 'print', 'redirect'])) {
            // Do not try to show user tours inside iframe, in maintenance mode,
            // when printing, or during redirects.
            return;
        }

        if (self::$bootstrapped) {
            return;
        }
        self::$bootstrapped = true;

        if ($tour = manager::get_current_tour()) {
            $PAGE->requires->js_call_amd('tool_usertours/usertours', 'init', [
                    $tour->get_id(),
                    $tour->should_show_for_user(),
                    $PAGE->context->id,
                ]);
        }
    }
1128534
public function boot()
    {
        Validator::extend('beforeDateField', function ($attribute, $value, $parameters, $validator) {
            return $this->checkDate($value, $parameters, $validator, 'lt');
        });

        Validator::extend('afterDateField', function ($attribute, $value, $parameters, $validator) {
            return $this->checkDate($value, $parameters, $validator, 'gt');
        });
    }
1156044
public function bootstrap()
    {

        // Start the rudimental system
        try {

            // Load settingsfile
            $this->loadSettings();

            // From here starts output buffering
            ob_start();

            // Registe PSR classloader
            $this->registerClassloader();

            // Create core DI container instance and map the instance to comntainer
            $this->di = \Core\DI\DI::getInstance();
            $this->di->mapValue('core.di', $this->di);

            $this->initLogger();

            // Run inits
            $this->initDatabase();
            $this->initMessageHandler();
            $this->initDependencies();
            $this->initHttp();
            $this->initSession();
            $this->initConfig();
            $this->initMailer();
            $this->initRouter();

            // Get an instance of Core app
            $this->getAppInstance('Core');

            $this->initSecurity();
            $this->initPage();
            $this->initAssetManager();

            // Run highlevel system
            $this->autodiscoverApps();

            // Match request against the generic routes to get the ajax request flag and to match a fallback result.
            $this->router->match();

            // Initiate apps
            $this->initApps();

            // Match routes again as now possible app routes are available
            $this->router->match();

            // Run dispatcher
            $result = $this->dispatch();

            // Send mails
            $this->mailer->send();

            // Process all assets
            $this->processAssets();

            // Send cookies
            $this->http->cookies->send();

            // Redirect requested?
            if (!empty($_SESSION['Core']['redirect'])) {

                $this->http->header->location($_SESSION['Core']['redirect']['location'], $_SESSION['Core']['redirect']['permanent']);
                $this->http->header->send();

                // Important: Clear redirect from session!
                unset($_SESSION['Core']['redirect']);

                return;
            }

            switch ($this->router->getFormat()) {

                case 'file':
                    $sendfile = new Sendfile($result);
                    $sendfile->send();

                    break;

                case 'html':

                    $this->http->header->contentType('text/html', 'utf-8');

                    $language = $this->getAppInstance('Core')->language;

                    // Add logoff button for logged in users
                    if ($this->user->isGuest()) {
                        $this->page->menu->createItem('register', $language->get('menu.register'), $this->router->generate('core.register'));
                        $this->page->menu->createItem('login', $language->get('menu.login'), $this->router->generate('core.login', [
                            'action' => 'login'
                        ]));
                    }

                    // or add login and register buttons. But not when current user is currently on banlist
                    else {

                        $usermenu = $this->page->menu->createItem('login', $this->user->getDisplayname());

                        // Show admin menu?
                        if ($this->user->getAdmin()) {
                            $usermenu->createItem('admin', $language->get('menu.admin'), $this->router->generate('core.admin'));
                        }

                        $usermenu->createItem('logout', $language->get('menu.logout'), $this->router->generate('core.login', [
                            'action' => 'logout'
                        ]));
                    }

                    $this->page->setHome($this->config->get('Core', 'url.home'));
                    $this->page->setContent($result);

                    $result = $this->page->render();
            }

            // Send headers so far
            $this->http->header->send();
        }
        catch (\Throwable $t) {

            $error = new ErrorHandler($t);
            $error->setAjax(isset($_REQUEST['ajax']));
            $error->setPublic(isset($this->user) && $this->user->getAdmin());
            $error->setPublic(true);

            if (isset($this->logger)) {
                $error->setLogger($this->logger);
            }

            http_response_code(500);

            $result = $error->handle();
        }

        echo $result;

        ob_end_flush();
    }
94255
private function initialize(): void
    {
        if (!$this->isBootstrapLayout()) {
            return;
        }

        switch ($this->layout->cols) {
            case '2cll':
                $this->leftClass = $this->layout->bs_leftClass;
                $this->mainClass = $this->layout->bs_mainClass;
                break;

            case '2clr':
                $this->rightClass = $this->layout->bs_rightClass;
                $this->mainClass  = $this->layout->bs_mainClass;
                break;

            case '3cl':
                $this->leftClass  = $this->layout->bs_leftClass;
                $this->rightClass = $this->layout->bs_rightClass;
                $this->mainClass  = $this->layout->bs_mainClass;
                break;

            default:
                $this->useGrid = false;

                return;
        }

        $this->useGrid = true;
    }
439384
public function bootstrap()
    {
        $this->router = $this->app['router'];
        $this->middlewareGroups = array_merge([], $this->middlewareGroups, config('routing.middlewareGroups', []));
        $this->routeMiddleware = array_merge([], $this->routeMiddleware, config('routing.routeMiddleware', []));

        foreach ($this->middlewareGroups as $key => $middleware) {
            $this->router->middlewareGroup($key, $middleware);
        }

        foreach ($this->routeMiddleware as $key => $middleware) {
            $this->router->middleware($key, $middleware);
        }
    }
201105
protected function bootstrap() {

        $function_count = array();

        /**
         * If we have "do_all" workers, start them first
         * do_all workers register all functions
         */
        if (!empty($this->do_all_count) && is_int($this->do_all_count)) {

            for ($x=0;$x<$this->do_all_count;$x++) {
                $this->start_worker();
                /**
                 * Don't start workers too fast. They can overwhelm the
                 * gearmand server and lead to connection timeouts.
                 */
                usleep($this->config['worker_initial_spawn_splay']);
            }

            foreach ($this->functions as $worker => $settings) {
                if (empty($settings["dedicated_only"])) {
                    $function_count[$worker] = $this->do_all_count;
                }
            }

        }

        /**
         * Next we loop the workers and ensure we have enough running
         * for each worker
         */
        foreach ($this->functions as $worker=>$config) {

            /**
             * If we don't have do_all workers, this won't be set, so we need
             * to init it here
             */
            if (empty($function_count[$worker])) {
                $function_count[$worker] = 0;
            }

            while ($function_count[$worker] < $config["count"]) {
                $this->start_worker($worker);
                $function_count[$worker]++;;
                /**
                 * Don't start workers too fast. They can overwhelm the
                 * gearmand server and lead to connection timeouts.
                 */
                usleep($this->config['worker_initial_spawn_splay']);
            }

        }

        /**
         * Set the last code check time to now since we just loaded all the code
         */
        $this->last_check_time = time();

    }
794752
protected function bootstrap()
    {
        return array_walk($this->bootClasses, function ($bootstrapClass) {
            $this->container->make($bootstrapClass)->boot($this->container);
        });
    }
795848
public function bootstrap()
    {
        if (!$this->booted) {
            $this->container = $this->buildContainer();
            $this->router = $this->buildRouter();
            $this->booted = true;
        }
    }
183895
protected function bootstrap()
    {
        $this->make('Sun\Bootstrap\Application')->bootstrap();

        $this->make('Sun\Bootstrap\HandleExceptions')->bootstrap();

        $this->make('Sun\Bootstrap\Route')->bootstrap();

        $this->make('Sun\Bootstrap\Provider')->bootstrap();

        $this->route = $this->make('Sun\Contracts\Routing\Route');
    }
733769
public function beforeCompile(): void
	{
		$config = $this->validateConfig($this->defaults);

		$definitions = $config['all'] === true
			? $this->getContainerBuilder()->getDefinitions()
			: array_map(
				[$this->getContainerBuilder(), 'getDefinition'],
				array_keys($this->getContainerBuilder()->findByTag(self::TAG_INJECT_VALUE))
			);

		foreach ($definitions as $def) {
			// If class is not defined, then skip it
			if ($def->getType() === null) continue;

			// Inject @value into definitin
			$this->inject($def);
		}
	}
638459
public function bootstrap()
    {
        $providers = Zilf::$container->getShare('config')->get('services');

        foreach ($providers as $provider) {
            $instance = $this->createProvider($provider);
            $instance->register();
        }
    }
975253
public function bootstrap(): void
    {
        if (! $this->app->hasBeenBootstrapped()) {
            $this->app->bootstrapWith($this->bootstrappers());
        }
    }
1110332
protected function initialize() {
	$request   = bootstrap::get_library('request');
	$response  = bootstrap::get_library('response');
	$exception = bootstrap::get_library('exception');
	
	$this->url    = $request::get_url();
	$this->method = $request::get_method();
	
	if (empty($this->method)) {
		throw new $exception('unknown http method', $response::STATUS_METHOD_NOT_ALLOWED);
	}
}