Initializes Bot instance and all its dependencies.

@return ProvidersContainer
182117
public static function create()
    {
        $request = self::makeRequest();
        $response = self::makeResponse();

        return self::buildProvidersContainer($request, $response);
    }
565339
protected function buildContainer() {
		$cache = $this->getCache();
		if($cache) {
			if(($container = $cache->fetch('asgard.container')) instanceof \Asgard\Container\Container) {
				$container['kernel'] = $this;
				$container['errorHandler'] = $this->errorHandler;

				$this->container = $container;
				#make $this->container the default instance of Container, in case someones uses it
				\Asgard\Container\Container::setInstance($this->container);
				return $this->container;
			}
		}

		$bundles = $this->getAllBundles();
		#use the Container default instance, in case someones uses it
		$container = $this->container = \Asgard\Container\Container::singleton();
		$container['errorHandler'] = $this->errorHandler;
		$container['kernel'] = $this;
		$container['config'] = $this->getConfig();

		foreach($bundles as $bundle)
			$bundle->buildContainer($container);

		if($cache)
			$cache->save('asgard.container', $container);

		return $container;
	}
246176
protected function Init()
    {
        $this->container = new Container(Request::GetData('container'));
        $this->containerRights = new ContainerRights($this->container->GetUserGroupRights());
        $this->AddNameField();
        $this->AddUserGroupField();
        $this->AddSubmit();
        return parent::Init();
    }
1307974
protected function buildContainer()
    {
        $container = new ContainerBuilder(new ParameterBag($this->getContainerParameters()));
        $container->setResourceTracking(true);
        $container->set('kernel', $this);
        $container->set('application', $this->application);

        // Load the build file
        $this->getContainerLoader($container)->load($this->getBuildFile(), self::TYPE_BUILD_FILE);

        // Load the properties file
        $file = $this->getPropertiesFile();
        if ($file) {
            $this->getContainerLoader($container)->load($file, self::TYPE_PROPERTIES_FILE);
        }

        return $container;
    }
539707
public function initialize()
    {
        if (! $this->app instanceof Container) {
            throw new SandboxException('A base app has not been set.');
        }

        $this->setInitialConfig();
        $this->setInitialProviders();
        $this->setInitialResetters();

        return $this;
    }
1363504
protected function initSymfonyConsoleProvider()
    {
        if (!$this->mvc->hasCvpp('symfony.console')) {
            $this->mvc->registerProvider(new ConsoleSymfonyProvider(array(
                'modules'  => $this->mvc->setModules(),
                'commands' => array(
                    new ListCommand()
                )
            )));
        }
        
        return $this;
    }
689594
private function initLoaders()
    {
        $namespace = sprintf('%s\\ServiceLoader', __NAMESPACE__);
        $classes = ['MetadataCache', 'MetadataDrivers', 'MetadataFactory', 'Persisters', 'Rest', 'SearchClients'];

        foreach ($classes as $class) {
            $fqcn = sprintf('%s\\%s', $namespace, $class);
            $this->addLoader(new $fqcn);
        }
        return $this;
    }
540670
public function createContainer() : Container
    {
        $containerBuilder = new ContainerBuilder();

        foreach ($this->modules as $module) {
            $this->loadModule($containerBuilder, $module);
        }

        if (!empty($this->config)) {
            $containerBuilder->addDefinitions($this->config);
        }

        $this->configureContainerBuilder($containerBuilder);

        return $containerBuilder->build();
    }
954048
public function initializeContainer()
    {
        $this->container = new Container([
            'kernel.database'   => Fdb::class,
            'kernel.config'     => Config::class,
            'kernel.storage'    => Storage::class,
            'kernel.routing'    => '\\Routes::getRouter',
            'kernel.debug'      => Debug::enable($this->isDebug()),
        ]);

        $this->container->set('kernel.container', $this->container);
        $this->container->set('kernel.dispatch', new Dispatcher($this->container));
        $this->container->set('kernel', $this);
        $this->registerService($this->container);

        $this->container->singleton('kernel.dispatch')->dispatch('handle.error');
    }
794992
protected function makeNewContainer()
    {
        $container = new Container();
        $container->classSet($this->entityClass);
        $container->setPropertyMapper( PropertyMapperEntityData::class );
        return $container;
    }
57978
protected function initialize()
    {
        $this->container = new Container();

        $containerProvider = new ContainerProvider($this->disabledMethods, $this->disabledFormats);
        $this->container->register($containerProvider);

        $this->initialized = false;
    }
738945
private function initBundles()
    {
        $bundleLoader = $this->getContainer()->get('bundle.loader');
        if (!$bundleLoader->isRestored() && null !== $this->getConfig()->getBundlesConfig()) {
            $bundleLoader->load($this->getConfig()->getBundlesConfig());
        }

        return $this;
    }
908728
public function initDependencyContainer(Dependency\ContainerInterface $container = null)
    {
        if (null === $container) {
            $container = Dependency\Container::getInstance();
        }

        $this->dependencyContainer = $container;

        return $this;
    }
125282
public function getContainer(){
        if(null === $this->container){
            $factory    = (new ContainerFactory())
                ->append(\Fratily\Kernel\Container\KernelContainer::class)
            ;

            foreach($this->bundles as $bundle){
                if($bundle instanceof Bundle\ContainerRegisterInterface){
                    $bundle->containerRegister($factory);
                }
            }

            $this->container    = $factory->create([
                "kernel"    => $this,
            ]);
        }

        return $this->container;
    }
1271869
protected function buildContainer()
    {
        /** @var TheliaContainerBuilder $container */
        $container = parent::buildContainer();

        $this->loadConfiguration($container);
        $container->customCompile();

        return $container;
    }
129026
protected function initializeDependencies()
    {
        if ($this->securityContext === null) {
            $this->securityContext = Bootstrap::$staticObjectManager->get(Context::class);
        }

        if ($this->policyService === null) {
            $this->policyService = Bootstrap::$staticObjectManager->get(PolicyService::class);
        }
    }
1358732
protected function initializeContainer()
    {
        // First check if cache should be bypassed
        if ($this->bypassCache) {
            $this->getContainer();

            return;
        }

        // Prepare cache directory
        $this->prepareDirectory($this->cacheDir, 'cache');

        // Instantiate cache
        $cache = new ConfigCache(
            $this->cacheDir . '/container/' . $this->containerClassName . '.php',
            $this->debug
        );

        // Check if cache needs to be regenerated, depends on debug being set to true
        if (!$cache->isFresh()) {
            $this->getContainer();
            $this->dumpContainer($cache);
        }

        // Include container cache
        require_once $cache;

        // Instantiate container
        $this->innerContainer = new $this->containerClassName();
    }