Add the appropriate Command implementations to the Application.

@param \SpraySole\Application $App
@return void
972075
public function register(Application $App) {
        $App->addCommand(new \YourApp\Command\Foo());
        $App->addCommand(new \YourApp\Command\Bar());
        $App->addCommand(new \YourApp\Command\Baz());
    }
245572
protected function injectInitialServices(ApplicationInterface $app)
    {
        $app->getServicesFactory()->registerService(
            ['id' => 'application', 'instance' => $app],
            
            // all those are here for convenience only since 'application' gives access to all of them
            ['id' => 'config', 'instance' => $app->getConfig()],
            ['id' => 'events-handler', 'instance' => $app->getEventsHandler()]
        )
        ;
    }
1361121
protected function setThemeResolver(Application $app)
    {
        if ($app->resolved('view')) {
            $app->make('antares.theme')->resolving();
        } else {
            $app->resolving('view', function () use ($app) {
                $app->make('antares.theme')->resolving();
            });
        }
    }
272554
public function command($command)
    {
        if ($command instanceof CommandInterface) {
            $command->setContainer($this);
        }

        $this['console']->add($command);
    }
1047552
protected function bootstrap($app): void
    {
        $app->bootstrapWith([
            \Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables::class,
            \CrCms\Microservice\Bootstrap\LoadConfiguration::class,
            \CrCms\Microservice\Bootstrap\HandleExceptions::class,
            \CrCms\Microservice\Bootstrap\RegisterFacades::class,
            //\Illuminate\Foundation\Bootstrap\SetRequestForConsole::class,
            \Illuminate\Foundation\Bootstrap\RegisterProviders::class,
            \Illuminate\Foundation\Bootstrap\BootProviders::class,
        ]);
    }
233554
private function addDefaultArgumentsAndOptions(Application $app) {
    $app->getDefinition()
      ->addOption(
        new InputOption('--define', '-D', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Define a configuration item value.', [])
      );
    $app->getDefinition()
      ->addOption(
        new InputOption('--environment', NULL, InputOption::VALUE_REQUIRED, 'Set the environment to load config from blt/[env].yml file.', [])
      );
    $app->getDefinition()
      ->addOption(
        new InputOption('--site', NULL, InputOption::VALUE_REQUIRED, 'The multisite to execute this command against.', [])
      );
  }
1044149
public function install(ApplicationInterface $app)
    {
        try{
            $request = new ShellRequest($GLOBALS['argv'] ?? []);
            $app->request($request);

            // fire event
            $app->eventstream()->channel(Channels::SYSTEM)->push(Events::REQUEST_ATTACHED, $request);
        }
        catch(\Throwable $e)
        {
            throw new ModuleInstallationException(self::class, $e->getMessage(), $e);
        }
    }
632141
public function bootstrap(Application $app)
    {
        $this->setApp($app);

        error_reporting(-1);

        if (config('app.debug')) {
            Debug::enable(E_ALL, true);
        } else {
            Debug::enable(E_ALL & ~E_NOTICE, false);
        }

//        $handler = set_error_handler('var_dump');
//        $handler = is_array($handler) ? $handler[0] : null;
//        restore_error_handler();
//
//        if ($handler instanceof ErrorHandler) {
//            $app->getContainer()->share(ErrorHandler::class, $handler);
//        }
    }
292439
protected function addAssemblers(Application $app)
    {
        $app['descriptor.builder.assembler.factory'] = $app->share(
            function () {
                return new AssemblerFactory();
            }
        );

        $provider = $this;
        $app['descriptor.builder.assembler.factory'] = $app->share(
            $app->extend(
                'descriptor.builder.assembler.factory',
                function ($factory) use ($provider, $app) {
                    return $provider->attachAssemblersToFactory($factory, $app);
                }
            )
        );
    }
1294580
public function register(Application $app)
    {
        $this->loadConfigurations($app);
        $this->registerServices($app);
        $this->registerEventListener($app);
    }
1146027
public function register(Application $app)
    {
        $this->loadProviders();

        foreach ($this->controllerProviders as $class => $values) {
            $app->register(new $class, $values);
        }
    }
707945
public function inheritConfigure(Samurai\Application $app)
    {
        // environment
        $app->setEnv($this->getEnvFromEnvironmentVariables());

        // application dir.
        $app->addAppPathUsePsr4(__DIR__, __NAMESPACE__, 'Samurai\\', self::PRIORITY_LOW);
    }
731466
public function fire(Application $app)
    {
        if (!$this->confirmToProceed()) {
            return;
        }

        $this->output->writeln('<info>Run application migrations ...</info>');
        $this->call('migrate');

        $this->output->writeln('<info>Run modules migrations ...</info>');
        $installer = new ModulesInstaller($app['modules.loader']->getRegisteredModules());

        $installer->cleanOutputMessages();

        if ($this->input->getOption('rollback')) {
            $installer->resetModules();
        }

        $installer->migrateModules();

        foreach ($installer->getOutputMessages() as $message) {
            $this->output->writeln($message);
        }

        // Finally, if the "seed" option has been given, we will re-run the database
        // seed task to re-populate the database, which is convenient when adding
        // a migration and a seed at the same time, as it is only this command.
        if ($this->input->getOption('seed')) {
            $this->call('db:seed');
            $this->call('modules:seed');
        }
    }
687848
public function bootstrap(Application $app)
    {
        $items = [];

        $app->instance('config', $config = new Repository($items));

        $this->loadConfigurationFiles($app, $config);

        mb_internal_encoding('UTF-8');
    }
599518
protected function defineControllers(Application $app)
    {
        $this->createController('/payone', 'payone-index', 'Payone', 'index', 'index')->method('POST');
        $this->createController('/payone/getfile', 'payone-getfile', 'payone', 'index', 'getFile')->method('GET|POST');
        $this->createController('/payone/regular-redirect-payment-cancellation', 'payone-cancel-redirect', 'Payone', 'index', 'cancelRedirect')->method('GET');
        $this->createController('/payone/getinvoice', 'payone-getinvoice', 'Payone', 'index', 'getInvoice')->method('GET');
        $this->createController(
            static::EXPRESS_CHECKOUT_BUTTON_PATH,
            static::EXPRESS_CHECKOUT_BUTTON,
            'payone',
            'expressCheckout',
            'checkoutWithPaypalButton'
        )->method('GET');

        $this->createController(
            static::EXPRESS_CHECKOUT_INIT_PATH,
            static::EXPRESS_CHECKOUT_INIT,
            'payone',
            'expressCheckout',
            'initPaypalExpressCheckout'
        )->method('GET');

        $this->createController(
            static::EXPRESS_CHECKOUT_LOAD_DETAILS_PATH,
            static::EXPRESS_CHECKOUT_LOAD_DETAILS,
            'payone',
            'expressCheckout',
            'loadPaypalExpressCheckoutDetails'
        )->method('GET');

        $this->createController(
            static::EXPRESS_CHECKOUT_FAILURE_PATH,
            static::EXPRESS_CHECKOUT_FAILURE,
            'payone',
            'expressCheckout',
            'failure'
        )->method('GET');

        $this->createController(
            static::EXPRESS_CHECKOUT_BACK_PATH,
            static::EXPRESS_CHECKOUT_BACK,
            'payone',
            'expressCheckout',
            'back'
        )->method('GET');
    }
1042840
protected function checkForSpecificEnvironmentFile($app)
    {
        if ($app->runningInConsole() && ($input = new ArgvInput)->hasParameterOption('--env')) {
            if ($this->setEnvironmentFilePath(
                $app, $app->environmentFile().'.'.$input->getParameterOption('--env')
            )) {
                return;
            }
        }

        if (! env('APP_ENV')) {
            return;
        }

        $this->setEnvironmentFilePath(
            $app, $app->environmentFile().'.'.env('APP_ENV')
        );
    }
496808
public static function console($app)
  {
    if (Filesystem::isDirectory(Self::$dir . DIRECTORY_SEPARATOR . 'Commands')) {
      $app->craftsman->load(Self::$dir . DIRECTORY_SEPARATOR . 'Commands');
    }
  }