Bootstrap the Gateway instance with a GATEWAY_HOME if not already set in System properties.
165362
@Override
    public void configureGateway(Gateway gateway) {
        Properties properties = new Properties();
        properties.putAll(System.getProperties());

        String gatewayHome = properties.getProperty(Gateway.GATEWAY_HOME_PROPERTY);
        if ((gatewayHome == null) || "".equals(gatewayHome)) {
            ClassLoader loader = Thread.currentThread().getContextClassLoader();
            URL classUrl = loader.getResource("org/kaazing/gateway/server/Gateway.class");
            String urlStr;
            try {
                urlStr = URLDecoder.decode(classUrl.toString(), "UTF-8");
            } catch (UnsupportedEncodingException ex) {
                // it's not likely that UTF-8 will be unsupported, so in practice this will never occur
                throw new RuntimeException("Failed to configure Gateway", ex);
            }

            // The URL is coming from a JAR file.  The format of that is supposed to be
            // jar:<url>!/<packagepath>.  Normally the first part of the <url> section will be
            // 'file:', but could be different if somehow the JAR is loaded from the network.
            // We can only handle the 'file' case, so will check.
            int packageSeparatorIndex = urlStr.indexOf("!/");
            if (packageSeparatorIndex > 0) {
                urlStr = urlStr.substring(0, urlStr.indexOf("!/"));
                urlStr = urlStr.substring(4);  // remove the 'jar:' part.
            }

            if (!urlStr.startsWith("file:")) {
                throw new RuntimeException("The Gateway class was not loaded from a file, so we " +
                        "cannot determine the location of GATEWAY_HOME");
            }

            urlStr = urlStr.substring(5);  // remove the 'file:' stuff.
            File jarFile = new File(urlStr);
            gatewayHome = jarFile.getParentFile().getParent();
            properties.setProperty("GATEWAY_HOME", gatewayHome);
        }

        gateway.setProperties(properties);
    }
127693
protected static function boot()
    {
        parent::boot();

        static::creating(function ($comment) {
            $comment->{$comment->getKeyName()} = Uuid::uuid4()->toString();
        });
    }
261804
public function boot()
	{
		$this->package('wardrobe/core');
		$this->setConnection();
		$this->bindRepositories();
		$this->bootCommands();

		require_once __DIR__.'/../../themeHelpers.php';
		require_once __DIR__.'/../../routes.php';
		require_once __DIR__.'/../../filters.php';
	}
1146317
protected function bootstrapEnvironment () {
		$this["debug"]		= !!$this["app.config"]["environment.debug"];
		Errorhandler::register();
		ExceptionHandler::register($this["debug"]);
		Request::enableHttpMethodParameterOverride();
	}
873080
def bootpxe(reboot = false, persistent = false)
      bootstatus = config.bootpxe(persistent)
      # Only reboot if setting the boot flag was successful
      power.cycle if reboot && bootstatus
    end
511531
protected function _boot() {

			// Start the session
			session_start();

			// Create local inflector
			static::$inflector = Inflector::instance();

			// Create configuration
			$this->_configure();

			// Configure session :)
			session_set_cookie_params($this->config->sessionCookieExpireTime);
			if ($this->config->sessionRegenerateId) {
				session_regenerate_id();
			}
			
			// Apply Application's namespace
			AutoLoad::autoLoadNamespace($this->config->applicationNamespace, APP_PATH);

			// Auto load modules?
			if ($this->config->autoLoadModules == true) {
				$this->_loadModules();
			}

			// Create request
			$this->_request = new Request();
			
			// Check if static file exists?
			if ($this->config->staticThroughChickenWire && $this->_request->rawUri != '') {
			
				// In application?
				$filename = PUBLIC_PATH . $this->_request->rawUri;
				if (file_exists($filename)) {
					
					// Mime available?
					$mime = Mime::byFile($filename);
					
					// Send header
					Http::sendMimeType($mime);
					echo file_get_contents($filename);
					die;

				}

				// In modules
				foreach (Module::all() as $module) {

					// In this module?
					$regex = '/^' . preg_quote($module->urlPrefix, '/') . '\/(?<url>.+)$/';
					if (preg_match($regex, $this->_request->rawUri, $matches)) {

						// Does the file exist?
						$filename = $module->path . "/Public/" . $matches['url'];
						if (file_exists($filename)) {
							
							// Mime available?
							$mime = Mime::byFile($filename);
							
							// Send header
							Http::sendMimeType($mime);
							echo file_get_contents($filename);
							die;

						}

					} 

				}

			}

			// Try to route!
			$this->_matchRoute();

		}
205244
def set_gateway(self, gateway):
        '''
        
        '''
        self.gateway = gateway
        self.sectie.set_gateway(gateway)
1253131
public function bootstrap()
    {
        $identifiers = $this->_identifiers;
        $aliases     = $this->_aliases;

        if(!$this->isBootstrapped())
        {
            $manager = $this->getObject('manager');

            /*
             * Setup the component class locator
             *
             * Locators are always setup as the  cannot be cached in the registry objects.
             */
            foreach($this->_namespaces as $namespace => $path) {
                $manager->getClassLoader()->getLocator('component')->registerNamespace($namespace, $path);
            }

            /*
             * Load resources
             *
             * If cache is enabled and the bootstrapper has been run we do not reload the config resources
             */
            if(!$this->getConfig()->bootstrapped)
            {
                $factory = $this->getObject('object.config.factory');

                foreach($this->_files as $filename)
                {
                    $array = $factory->fromFile($filename, false);

                    if(isset($array['priority'])) {
                        $priority = $array['priority'];
                    } else {
                        $priority = self::PRIORITY_NORMAL;
                    }

                    if(isset($array['aliases']))
                    {
                        if(!isset($aliases[$priority])) {
                            $aliases[$priority] = array();
                        }

                        $aliases[$priority] = array_merge($aliases[$priority], $array['aliases']);;
                    }

                    if(isset($array['identifiers']))
                    {
                        if(!isset($identifiers[$priority])) {
                            $identifiers[$priority] = array();
                        }

                        foreach ($array['identifiers'] as $identifier => $config)
                        {
                            if (array_key_exists($identifier, $identifiers[$priority]))
                            {
                                $existing = new KObjectConfig($identifiers[$priority][$identifier]);
                                $existing->append($config);

                                $identifiers[$priority][$identifier] = $existing->toArray();
                            }
                            else $identifiers[$priority][$identifier] = $config;
                        }
                    }
                }

                /*
                * Set the identifiers
                *
                * Collect identifiers by priority and then flatten the array.
                */
                $identifiers_flat = array();

                krsort($identifiers);
                foreach ($identifiers as $priority => $merges) {
                    $identifiers_flat = array_replace_recursive($identifiers_flat, $merges);
                }

                foreach ($identifiers_flat as $identifier => $config) {
                    $manager->setIdentifier(new KObjectIdentifier($identifier, $config));
                }

                /*
                * Set the aliases
                *
                * Collect aliases by priority and then flatten the array.
                */
                $aliases_flat = array();

                foreach ($aliases as $priority => $merges) {
                    $aliases_flat = array_merge($merges, $aliases_flat);
                }

                foreach($aliases_flat as $alias => $identifier) {
                    $manager->registerAlias($identifier, $alias);
                }

                /*
                 * Reset the bootstrapper in the object manager
                 *
                 * If cache is enabled this will prevent the bootstrapper from reloading the config resources
                 */
                $identifier = new KObjectIdentifier('lib:object.bootstrapper', array(
                    'bootstrapped' => true,
                    'directories'  => $this->_directories,
                    'components'   => $this->_components,
                    'domains'      => $this->_domains,
                    'namespaces'   => $this->_namespaces,
                    'files'        => $this->_files,
                    'applications' => $this->_applications,
                    'aliases'      => $aliases_flat,
                ));

                $manager->setIdentifier($identifier)
                        ->setObject('lib:object.bootstrapper', $this);
            }
            else
            {
                foreach($aliases as $alias => $identifier) {
                    $manager->registerAlias($identifier, $alias);
                }
            }

            $this->_bootstrapped = true;
        }
    }
737412
public function bootstrap()
    {
        if (! $this->runningInConsole && $this->initializeFs()) {
            $this->buildFsTree();
            $this->initialized = true;
        }

        return $this->initialized;
    }
1314976
def set_gateway(self, gateway):
        '''
        
        '''
        self.gateway = gateway
        if (self._gemeente is not None):
            self._gemeente.set_gateway(gateway)
142242
public function bootstrap()
    {
        if (! class_exists(DotenvFactory::class)) {
            $this->writeErrorAndDie([
                'Unable to load the environment file!',
                'Please install "vlucas/phpdotenv:^3.3".',
            ]);
        }

        try {
            $this->createDotenv()->safeLoad();
        } catch (InvalidFileException $e) {
            $this->writeErrorAndDie([
                'The environment file is invalid!',
                $e->getMessage(),
            ]);
        }
    }
1240366
def _remove_legacy_bootstrap():
        """"""
        home = os.environ['HOME']
        old_base_dir = os.path.join(home, '.config', 'classpath_project_ensime')
        if os.path.isdir(old_base_dir):
            shutil.rmtree(old_base_dir, ignore_errors=True)
518217
private void bootstrap() {
    List<MemberId> activePeers = bootstrapPeersSupplier.get();
    if (activePeers.isEmpty()) {
      return;
    }
    try {
      requestBootstrapFromPeers(activePeers)
          .get(DistributedPrimitive.DEFAULT_OPERATION_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
    } catch (ExecutionException | InterruptedException | TimeoutException e) {
      LOGGER.debug("Failed to bootstrap ec map {}: {}", mapName, ExceptionUtils.getStackTrace(e));
    }
  }
542206
public function boot()
    {
        foreach ($this->app->make('config')->get('tenancy.multi_site.router.patterns', []) as $name => $pattern) {
            Route::pattern($name, $pattern);
        }

        parent::boot();
    }
389929
protected function bootstrapContainer()
    {
        static::setInstance($this);

        $this->instance('app', $this);
        $this->instance(self::class, $this);

        $this->instance('path', $this->path());
        $this->instance('path.base', $this->basePath());
        $this->instance('path.config', $this->basePath('resources/config'));
        $this->instance('path.database', $this->databasePath());
        $this->instance('path.storage', $this->storagePath());
        $this->instance('path.resources', $this->resourcePath());
        $this->instance('path.bootstrap', $this->bootstrapPath());

        $this->instance('env', $this->environment());

        $this->registerContainerAliases();
    }
143323
def setup(self, quiet=False, bootstrap_server=False):
        """"""
        def lazy_initialize_ensime():
            if not self.ensime:
                called_by = inspect.stack()[4][3]
                self.log.debug(str(inspect.stack()))
                self.log.debug('setup(quiet=%s, bootstrap_server=%s) called by %s()',
                               quiet, bootstrap_server, called_by)

                installed = self.launcher.strategy.isinstalled()
                if not installed and not bootstrap_server:
                    if not quiet:
                        scala = self.launcher.config.get('scala-version')
                        msg = feedback["prompt_server_install"].format(scala_version=scala)
                        self.editor.raw_message(msg)
                    return False

                try:
                    self.ensime = self.launcher.launch()
                except InvalidJavaPathError:
                    self.editor.message('invalid_java')  # TODO: also disable plugin

            return bool(self.ensime)

        def ready_to_connect():
            if not self.ws and self.ensime.is_ready():
                self.connect_ensime_server()
            return True

        # True if ensime is up and connection is ok, otherwise False
        return self.running and lazy_initialize_ensime() and ready_to_connect()
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);
        }
    }