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

@return void
513392
public function bootstrap()
    {

        // setup autoloader
        require SERVER_AUTOLOADER;

        // enable garbage collection
        gc_enable();

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

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

        // try to load the profile logger
        if ($this->profileLogger = $this->getApplication()->getInitialContext()->getLogger(LoggerUtils::PROFILE)) {
            $this->profileLogger->appendThreadContext('startup-bean-task-garbage-collector');
        }
    }
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;
    }
1358246
public function boot()
    {
        if ($this->app instanceof \Laravel\Lumen\Application) {
            $this->bootLumen();
        } else {
            $this->bootLaravel();
        }
    }
281458
public function bootstrap()
    {
        $this->services = $this->app->config('provider');

        if(!is_null($services = $this->services)) {
            foreach($services as $service) {
                $this->app->make($service)->bootstrap();
            }
        }
    }
135299
protected function before()
    {
        if (    empty($this->client)
            ||  empty($this->clientHash)
            ||  $this->clientHash !== $this->makeSoapClientHash()
        ) {
            $this->initializeClient();
        }
    }
1298634
protected function bootstrapContainer()
    {
        static::setInstance($this);
        
        $this->instance('app', $this);
        
        $this->bootstrapEnvironment();
        
        $this->bindPathsInContainer();
        $this->registerContainerAliases();
        $this->registerCoreServices();
        $this->registerLogBindings();
        $this->registerTheme();
    }
591698
public function before()
    {

        // ~ Init timer
        $this->time = - microtime(true);

        // ~ Reporting all error (default: all error) !
        error_reporting((int) $this->argument->get('error-reporting', null, - 1));
        ini_set('display_errors', (bool) $this->argument->get('error-display', null, 1));

        // ~ Set limit time to 0 (default: unlimited) !
        set_time_limit((int) $this->argument->get('time-limit', null, 0));

        $this->isVerbose = ! $this->argument->has('quiet');
    }
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);
    }
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();

    }
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__);
            }
        }
    }
723506
protected function bootstrap()
    {
        if($this->_isBooted) {
            return;
        }

        swoole_set_process_name($this->name . ':master');
        $this->installSignals();
        $this->_isBooted = true;
    }
667392
public function bootstrap()
    {

        // setup autoloader
        require SERVER_AUTOLOADER;

        // register the application's class loaders
        $application = $this->getApplication();
        $application->registerClassLoaders();

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

        // try to load the system logger
        $this->systemLogger = $this->getLogger(LoggerUtils::SYSTEM);

        // try to load the profile logger
        if ($this->profileLogger = $this->getLogger(LoggerUtils::PROFILE)) {
            $this->profileLogger->appendThreadContext('servlet-engine-garbage-collector');
        }
    }
1037076
public static function bootstrap_init() {
        global $CFG, $SITE, $DB, $FULLME;

        // backup the globals
        self::$globals['_SERVER'] = $_SERVER;
        self::$globals['CFG'] = clone($CFG);
        self::$globals['SITE'] = clone($SITE);
        self::$globals['DB'] = $DB;
        self::$globals['FULLME'] = $FULLME;

        // refresh data in all tables, clear caches, etc.
        self::reset_all_data();
    }
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,
                ]);
        }
    }
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);
        }
    }
44484
protected function bootstrap()
    {
        (new Presets\Bootstrap($this->filesystem))->install();
        $this->info('Bootstrap scaffolding installed successfully.');
        $this->comment('Please run "npm install && npm run dev" to compile your fresh scaffolding.');
    }
1250629
protected function bootstrap()
    {
        parent::bootstrap();

        $this->viewPath = __DIR__ . '/views';

        if (!isset($this->i18n->translations['colibri'])) {
            $this->i18n->translations['colibri'] = [
                'class' => 'yii\i18n\PhpMessageSource',
                'basePath' => __DIR__ . '/messages'
            ];
        }

        // Look in @app/messages directory for all categories
        if (!isset($this->i18n->translations['*'])) {
            $this->i18n->translations['*'] = [
                'class' => 'yii\i18n\PhpMessageSource',
                'basePath' => '@app/messages'
            ];
        }

        if (!file_exists($this->basePath . '/.env')) {
            // Remove query part
            $url = preg_replace('/\?.*$/', '', $this->getRequest()->url);

            if ($url != '/install') {
                $this->getResponse()->redirect(['/install']);
            }

            /* Now the route is install.
             *
             * Set the minimal layout to avoid potential db queries in the main layout
             */
            $this->layout = 'minimal';
        }
    }