Exemplo n.º 1
0
 /**
  * Called after all addConfigFolder() calls, this function
  * actually loads all the symfony config files such as
  * services.yml
  */
 public static function loadAll()
 {
     $containerLoader = new ContainerLoader();
     $loadedContainer = $containerLoader->loadDIConfig(self::$cacheDirPath, self::$cacheEnabled, self::$extensions, ContainerBridge::getContainer());
     ContainerBridge::setContainer($loadedContainer);
     $routingLoader = new RoutingLoader();
     $loadedRouteCollection = $routingLoader->loadRouting(self::$bundlePaths, self::$cacheDirPath, self::$cacheEnabled, RouteBridge::getRouteCollection());
     RouteBridge::setRouteCollection($loadedRouteCollection);
 }
Exemplo n.º 2
0
 /**
  * Called after all addConfigFolder() calls, this function
  * actually loads all the symfony config files such as
  * services.yml
  */
 public function loadBundles($symfonizeConfig)
 {
     $extensions = [];
     $bundlePaths = [];
     foreach ($symfonizeConfig['bundles'] as $bundle) {
         $extension = $bundle->getContainerExtension();
         if ($extension) {
             $extensions[] = $extension;
         }
         $bundlePaths[] = $bundle->getPath();
     }
     $cacheDir = $symfonizeConfig['cache_dir'] . '/symfonize-cache';
     $containerLoader = new ContainerLoader();
     $loadedContainer = $containerLoader->loadDIConfig($cacheDir, !$symfonizeConfig['debug'], $extensions, ContainerBridge::getContainer());
     ContainerBridge::setContainer($loadedContainer);
     $routingLoader = new RoutingLoader();
     $loadedRouteCollection = $routingLoader->loadRouting($bundlePaths, $cacheDir, !$symfonizeConfig['debug'], RouteBridge::getRouteCollection());
     RouteBridge::setRouteCollection($loadedRouteCollection);
 }