本文整理汇总了PHP中Symfony\Component\HttpKernel\Kernel::initializeContainer方法的典型用法代码示例。如果您正苦于以下问题:PHP Kernel::initializeContainer方法的具体用法?PHP Kernel::initializeContainer怎么用?PHP Kernel::initializeContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\HttpKernel\Kernel
的用法示例。
在下文中一共展示了Kernel::initializeContainer方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initializeContainer
protected function initializeContainer()
{
parent::initializeContainer();
/** @var SymfonyContainerBridge $rootContainer */
$rootContainer = $this->getContainer();
$rootContainer->setFallbackContainer($this->getPHPDIContainer());
}
示例2: initializeContainer
protected function initializeContainer()
{
parent::initializeContainer();
if (PHP_SAPI == 'cli') {
$this->getContainer()->enterScope('request');
$this->getContainer()->set('request', new \Symfony\Component\HttpFoundation\Request(), 'request');
}
}
示例3: initializeContainer
/**
* PHP-DIのコンテナを初期化する。
*/
protected function initializeContainer()
{
parent::initializeContainer();
$builder = new \DI\ContainerBuilder();
$builder->wrapContainer($this->getContainer());
$builder->useAnnotations(true);
$this->getContainer()->setFallbackContainer($builder->build());
}
示例4: initializeContainer
protected function initializeContainer()
{
parent::initializeContainer();
try {
$timeZone = $this->getContainer()->get('system_preferences_service')->TimeZone;
if (!empty($timeZone)) {
date_default_timezone_set($timeZone);
}
} catch (\Exception $e) {
}
// Set temp dir for Newscoop to project cache directory
putenv(sprintf('TMPDIR=%s/../cache', __DIR__));
}
示例5: initializeContainer
/**
* Only check configuration difference on first test case. The rest test cases might be the same ;).
*
* @throws Exception
*/
protected function initializeContainer()
{
static $first = true;
if ('test' !== $this->getEnvironment()) {
parent::initializeContainer();
return;
}
$debug = $this->debug;
if (!$first) {
// disable debug mode on all but the first initialization
$this->debug = false;
}
// will not work with --process-isolation
$first = false;
try {
parent::initializeContainer();
} catch (\Exception $e) {
$this->debug = $debug;
throw $e;
}
$this->debug = $debug;
}
示例6: initializeContainer
/**
* Add custom error handler
*/
protected function initializeContainer()
{
$handler = new ErrorHandler();
$handler->registerHandlers();
parent::initializeContainer();
}
示例7: initializeContainer
protected function initializeContainer()
{
parent::initializeContainer();
$this->getContainer()->enterScope('request');
$this->getContainer()->set('request', new Request(), 'request');
}
示例8: initializeContainer
protected function initializeContainer()
{
\CampaignChain\CoreBundle\Util\SystemUtil::redirectInstallMode();
parent::initializeContainer();
date_default_timezone_set('UTC');
}
示例9: initializeContainer
protected function initializeContainer()
{
parent::initializeContainer();
static::$_container = $this->getContainer();
}
示例10: initializeContainer
/**
* {@inheritdoc}
*/
protected function initializeContainer()
{
parent::initializeContainer();
$injector = new Injector(new AppModule());
$this->getContainer()->setInjector($injector);
}
示例11: initializeContainer
/**
* Overrides the parent method to add the loader to the container.
*
* {@inheritdoc}
*/
protected function initializeContainer()
{
parent::initializeContainer();
$this->container->set('composer.loader', $this->loader);
}
示例12: initializeContainer
protected function initializeContainer()
{
// remove the cache dir when installing a module to trigger rebuilding the kernel
if ($this->isInstallingModule()) {
$fileSystem = new Filesystem();
$fileSystem->remove($this->getCacheDir() . '/' . $this->getContainerClass() . '.php');
}
parent::initializeContainer();
}
示例13: initializeContainer
protected function initializeContainer()
{
parent::initializeContainer();
// Inject the registry to the container
$this->getContainer()->set('vivait_tenant.registry', $this->getTenantRegistry());
}
示例14: initializeContainer
/**
* Initializes the service container.
*
* The cached version of the service container is used when fresh, otherwise the
* container is built.
*
* Overridden not to dump the container.
*/
protected function initializeContainer()
{
if (true === $this->dump) {
return parent::initializeContainer();
}
$this->container = $this->buildContainer();
$this->container->set('kernel', $this);
}