示例#1
0
文件: Bootstrap.php 项目: acp3/core
 /**
  * @param SymfonyRequest $symfonyRequest
  * @param string $filePath
  */
 private function dumpContainer(SymfonyRequest $symfonyRequest, $filePath)
 {
     $containerConfigCache = new ConfigCache($filePath, $this->appMode === ApplicationMode::DEVELOPMENT);
     if (!$containerConfigCache->isFresh()) {
         $containerBuilder = ServiceContainerBuilder::create($this->appPath, $symfonyRequest, $this->appMode);
         $dumper = new PhpDumper($containerBuilder);
         $containerConfigCache->write($dumper->dump(['class' => 'ACP3ServiceContainer']), $containerBuilder->getResources());
     }
 }
示例#2
0
 /**
  * @param Core\Http\RequestInterface $request
  * @param bool $allModules
  * @return \Symfony\Component\DependencyInjection\ContainerBuilder
  */
 public function updateServiceContainer(Core\Http\RequestInterface $request, $allModules = false)
 {
     return Core\DependencyInjection\ServiceContainerBuilder::create($this->appPath, $request->getSymfonyRequest(), $this->environment, $allModules);
 }