Run the command in the foreground.

@param Application $app
330935
protected function runCommandInForeground(Application $app)
    {
        (new Process(
            trim($this->buildCommand(), '& '), dirname($app->request->getScriptFile()), null, null, null
        ))->run();
        $this->callAfterCallbacks($app);
    }
1092880
public function boot(Application $app)
    {
        if (!$this->registered) {
            throw new \RuntimeException('Can not boot extensions prior to completion of registration.');
        }
        if ($this->booted) {
            throw new \RuntimeException('Can not re-boot extensions.');
        }

        // Boot all extension loaders that are also service providers
        foreach ($this->extensions as $extension) {
            if ($extension->isEnabled() !== true) {
                continue;
            }
            foreach ($extension->getInnerExtension()->getServiceProviders() as $provider) {
                $provider->boot($app);
            }
        }
        $this->loaded = true;
        $this->booted = true;
    }
442127
protected function runCommand(InputInterface $input, OutputInterface $output)
    {
        $appName = $input->getArgument('app-name');
        list($_, $indexUUID) = $this->getRepositoryAndIndex($input, $output);

        $this
            ->repositoryBucket
            ->findRepository($appName)
            ->resetIndex($indexUUID);
    }
223221
public function run(ApplicationInterface $app)
    {
        $config = $app->getConfig();
        
        $servicesFactory = $app->getServicesFactory();
        
        $this->injectInitialServices($app);
        
        foreach ($config->get(Service::class, []) as $serviceSpec) {
            $servicesFactory->registerService($serviceSpec);
        }
    }
264825
public function run(Container $container)
    {
        if ((! $this->ignoreMutex) && $this->withoutOverlapping && (! $this->setMutex())) {
            return;
        }

        ((! $this->forceRunInForeground) && $this->runInBackground)
            ? $this->newCommandInBackground($container)
            : $this->runCommandInForeground($container);
    }
610155
public function bootstrap(Application $app)
    {
        if ($app->configurationIsCached()) {
            return;
        }

        $this->checkForSpecificEnvironmentFile($app);
        try {
            (new Dotenv($app->environmentPath(), $app->environmentFile()))->load();
        } catch (InvalidPathException $e) {
            //
        }
    }
1105719
public function setApplication($app)
    {
        Argument::i()->test(1, 'string');

        $this->application = $app;
        return $this->setData($this->message);
    }
496808
public static function console($app)
  {
    if (Filesystem::isDirectory(Self::$dir . DIRECTORY_SEPARATOR . 'Commands')) {
      $app->craftsman->load(Self::$dir . DIRECTORY_SEPARATOR . 'Commands');
    }
  }
799532
public function run(Container $container)
	{
		if (count($this->afterCallbacks) > 0)
		{
			$this->runCommandInForeground($container);
		}
		else
		{
			$this->runCommandInBackground();
		}
	}
814951
protected function runCommandInBackground()
    {
        $this->callBeforeCallbacks();

        (new Process(
            $this->buildCommand(), base_path(), null, null, null
        ))->run();
    }
1035167
private static function runAppMiddleware()
    {
        $appMiddleware = Filter::$middleware;

        foreach ($appMiddleware as $middleware) {
            $middleware = instance($middleware);

            $middleware->handle(new Request());
        }

        return true;
    }
969498
public function run(Application $app)
    {
        $response = call_user_func_array($this->callback, array_merge($this->parameters, [$app]));
        parent::callAfterCallbacks($app);

        return $response;
    }
1089834
public function boot(Application $app)
    {

        // Register our filters to use
        if (isset($app['assetic.filters']) && is_callable($app['assetic.filters'])) {
            $app['assetic.filters']($app['assetic.filter_manager']);
        }

        /**
         * Writes down all lazy asset manager and asset managers assets
         */
        $app->after(function () use ($app) {
            // Boot assetic
            $assetic = $app['assetic'];

            if (!isset($app['assetic.options']['auto_dump_assets']) ||
                !$app['assetic.options']['auto_dump_assets']) {
                return;
            }
            $helper = $app['assetic.dumper'];
            if (isset($app['twig'])) {
                $helper->addTwigAssets();
            }
            $helper->dumpAssets();
        });
    }
240219
public function run(array $options): void
    {
        // run once
        $this->___checkRun(new AppException("You cannot call App::run() anymore, it's already ".
                "called in skeleton/pub/index.php once"));

        // apply user options (@see skeleton/pub/index.php)
        if (isset($options['env'])) $this->env = $options['env'];
        if (isset($options['root'])) $this->root = $options['root'];
        if (isset($options['config'])) $this->applyConfig($options['config']);

        // check env
        if (empty($this->env)) {
            throw new AppException('Application env is not defined');
        }

        // security & performans checks
        $halt = $this->haltCheck();
        if ($halt != null) {
            $this->halt($halt[1], $halt[0]);
        }

        $this->applyDefaults();

        $this->request = new Request($this);
        $this->response = new Response($this);

        // @override
        set_global('app', $this);

        // create service
        $service = ServiceFactory::create($this);
        if ($service == null) {
            throw new AppException('Could not create service');
        }

        $this->startOutputBuffer();

        // here!!
        $this->events->fire('service.beforeRun');
        $output = $service->run();
        $this->events->fire('service.afterRun');

        $this->endOutputBuffer($output);
    }
585991
protected function runApplicationWithEvents()
    {
        $this->prepareEnvironment();

        if (static::$before) {
            $this->runBeforeCallbacks();
        }
        // read configs/general.php for register aliases
        $this->readGeneralConfigs();
        // register all aliases
        $this->registerAliases();
        // register helpers;
        $this->resolveHelpers();

        //execute the service providers
        $this->prepareServiceProviders();

        if (static::$after) {
            $this->runAfterCallbacks();
        }
    }
301286
public function startApplication() : void
    {
        if ($this->hasApplicationBeenStarted()) {
            throw new ApplicationRunningException(sprintf('Application has already been started. Please stop the application, before invoking start!'));
        }

        $this->refreshApplication();

        if (!$this->factory) {
            $this->factory = $this->app->make(Factory::class);
        }
    }
210028
public function bootstrap(Application $app)
    {
        if ($app->configurationIsCached()) {
            return;
        }

        $this->checkForSpecificEnvironmentFile($app);

        try {
            $this->createDotenv($app)->safeLoad();
        } catch (InvalidFileException $e) {
            $this->writeErrorAndDie($e);
        }
    }