Создаёт инстансы для всех приложений, описанных в разделе "applications" конфига.

@return ApplicationInterface[]
6656
public function instanceAllApps(): array
    {
        $allAppIds = $this->applicationConfig->getAllApplicationIds();

        return array_map(function (string $id) {
            return $this->instanceAppById($id);
        }, $allAppIds);
    }
616093
public function getAppRoutes()
    {
        $key = __METHOD__;
//        $cache = Configs::instance()->cache;
        $cache = null;
        if ($cache === null || ($result = $cache->get($key)) === false) {
            $result = [];
            $this->getRouteRecrusive(Yii::$app, $result);
            if ($cache !== null) {
                $cache->set($key, $result, Configs::instance()->cacheDuration, new TagDependency([
                    'tags' => self::CACHE_TAG
                ]));
            }
        }

        return $result;
    }
211743
public function getList(): array
    {
        $result = [];
        $controllers = Utility::getControllers();

        if (empty($controllers)) {
            return $result;
        }

        foreach ($controllers as $controller) {
            $parts = explode('\\', $controller);
            foreach ($parts as $key => &$part) {
                if ('App' === $part) {
                    unset($parts[$key]);
                    continue;
                }

                $part = str_replace('Controller', '', $part);
                $part = Inflector::humanize(Inflector::underscore($part));
            }

            // remove empty values
            $parts = array_filter($parts);

            $key = App::shortName($controller, 'Controller', 'Controller');
            $value = implode(' - ', $parts);
            $result[$key] = $value;
        }

        // sort by value
        asort($result);

        return $result;
    }
856962
protected function getFunctions() {
        if (!$this->_functions) {
            $this->_functions = new FunctionList($this->version, $this->solution['sid']);
        }

        return $this->_functions;
    }
954982
public function getMigrationsClasses()
    {
        $appFiles = $this->getMigrationsFiles();
        $classes = [];

        /* @var $component AppInterface */
        foreach ($appFiles as $appName => $migrationFiles) {
            $component = $this->orm->getComponent($appName);
            foreach ($migrationFiles as $migrationFile) {
                $className = ClassHelper::getClassFromFile($migrationFile);
                $foundClass = ClassHelper::classExists(
                    $className,
                    $component->getNamespace()
                );
                if (!$foundClass) {
                    throw new ClassNotFoundException(
                        sprintf(
                            'The class [ %2$s\\%1$s or \\%1$s ] '.
                            'could not be located',
                            $className,
                            $component->getNamespace()
                        )
                    );
                }
                $classes[$appName][] = $foundClass;
            }
        }

        return $classes;
    }
413495
public function commonApplicationAttributes()
    {
        return [
            'modules' => [
                'users' => [
                    'emailConfirmationNeeded' => (bool)$this->emailConfirmationNeeded,
                    'allowLoginInactiveAccounts' => (bool)$this->allowLoginInactiveAccounts,
                    'enableSocialNetworks' => (bool)$this->enableSocialNetworks,
                    'logLastLoginTime' => (bool)$this->logLastLoginTime,
                    'logLastLoginData' => (bool)$this->logLastLoginData,
                    'passwordResetTokenExpire' => (int)$this->passwordResetTokenExpire,
                    'loginDuration' => (int)$this->loginDuration,
                    'generatedPasswordLength' => (int)$this->generatedPasswordLength,
                ]
            ],
        ];
    }
554340
public function getAppNames()
    {
        $apps = [];
        if ($projectRoot = $this->getWelcomeCommand()->getProjectRoot()) {
            foreach (LocalApplication::getApplications($projectRoot) as $app) {
                $name = $app->getName();
                if ($name !== null) {
                    $apps[] = $name;
                }
            }
        } elseif ($project = $this->getProject()) {
            if ($environment = $this->api->getEnvironment('master', $project, false)) {
                $apps = array_keys($environment->getSshUrls());
            }
        }

        return $apps;
    }
1301161
public function setPaths() : ApplicationInterface
    {
        $this->container->set('app', $this);
        $paths = $this->bootstrappers->getBootstrapper()->getPaths();

        foreach ($paths->all() as $key => $path) {
            $this->container->set($key, $path);
        }

        return $this;
    }
521279
public function getApplication()
    {
        //load drupals autoload.php, so their classes are available
        if (file_exists('./vendor/autoload.php')) {
            $autoloader = require './vendor/autoload.php';
        } else {
            $autoloader = require '../vendor/autoload.php';
        }

        $sitePath = 'sites/default';

        Settings::initialize('./', $sitePath, $autoloader);

        $app = new DrupalKernel($this->appenv, $autoloader);
        $app->setSitePath($sitePath);

        return $app;
    }
976589
public function getMiddleware() : array
    {
        if (!$this->providesMiddleware()) {
            return [];
        }

        $allControllerMiddleware = array_filter(
            $this->getController()->getControllerMiddleware(),
            function (ControllerMiddleware $middleware) {
                return !$middleware->excludedForMethod($this->controllerMethod);
            }
        );

        return array_map(
            function ($controllerMiddleware) {
                return $controllerMiddleware->middleware();
            },
            $allControllerMiddleware
        );
    }
107396
private function getModuleProviders()
    {
        $defaultProviders = [
            'vegas-cmf'
        ];

        $appConfig = $this->di->get('config')->application;
        if (!isset($appConfig->vendorModuleProvider)) {
            $providerNames = [];
        } else if (is_string($appConfig->vendorModuleProvider)) {
            $providerNames = [$appConfig->vendorModuleProvider];
        } else {
            $providerNames = $appConfig->vendorModuleProvider->toArray();
        }

        return array_unique(array_merge($defaultProviders, $providerNames));
    }
868245
public function generateLinksApplications(array $applications)
    {
        $links = [];

        foreach ($applications as $application) {
            if ($this->codeApplication === $application->getCode()) {
                continue;
            }

            $links[] = [
                'href' => $application->getHref(),
                'title' => $application->getTitle(),
            ];
        }

        return $links;
    }
96334
protected function getAppParameters()
    {
        return array_merge(
            array(
                'app.root_dir' => $this->rootDir,
                'app.environment' => $this->environment,
                'app.debug' => $this->debug,
                'app.name' => $this->name,
                'app.cache_dir' => $this->getCacheDir(),
                'app.logs_dir' => $this->getLogDir(),
                'app.charset' => $this->getCharset(),
            ),
            $this->getEnvParameters()
        );
    }
145282
public function middleware(): array
    {
        return [
            PhpEnvironment::class,
            EmitResponse::class,
            HandleExceptions::class,
            ReadConfigIni::class,
            UseDatabase::class,
            UseDebugbar::class,
            UpdateDatabaseSchema::class,
            UseCache::class,
            UseFilesystem::class,
            UseSession::class,
            UseTree::class,
            UseLocale::class,
            CheckForMaintenanceMode::class,
            UseTheme::class,
            DoHousekeeping::class,
            CheckCsrf::class,
            UseTransaction::class,
            BootModules::class,
            ModuleMiddleware::class,
            RequestRouter::class,
            NoRouteFound::class,
        ];
    }
932452
public function getServices()
    {
        return [
            self::INFLECTOR           => function () { return Inflector::get('en');},
            self::APPLICATION_RUNTIME => function () { return new ApplicationRuntime();},
            self::CONFIG_FACTORY      => function () { return new ConfigFactory();}
        ];
    }
521436
protected function application()
    {
        return $this->grid->fieldset(trans('antares/foundation::label.settings.application'), function (Fieldset $fieldset) {
                    $fieldset->legend('Application configuration');

                    $fieldset->control('select', 'mode')
                            ->label(trans('antares/foundation::label.mode'))
                            ->options([
                                'production'  => trans('antares/foundation::global.modes.production'),
                                'development' => trans('antares/foundation::global.modes.development'),
                            ])
                            ->labelWrapper(['class' => 'col-mb-8 col-6 col-dt-4 col-ld-4']);

                    $fieldset->control('button', 'cancel')
                            ->field(function() {
                                return app('html')->link(handles("antares::/"), trans('antares/foundation::label.cancel'), ['class' => 'btn btn--md btn--default mdl-button mdl-js-button']);
                            });

                    $fieldset->control('button', 'button')
                            ->attributes(['type' => 'submit'])
                            ->value(trans('antares/foundation::label.save_changes'));
                });
    }
1138457
public function getComponents () : array
    {
        if (null === $this->components)
        {
            $this->components = $this->loader->loadComponents($this);
        }

        return $this->components;
    }