コード例 #1
0
 /**
  * Hydrates container with application core parameters (like bbapp.context, bbapp.environement, etc.).
  */
 private function hydrateContainerWithApplicationParameters()
 {
     $this->container->setParameter('bbapp.context', $this->context);
     $this->container->setParameter('bbapp.environment', $this->environment);
     $this->container->setParameter('environment', $this->environment);
     // set default backbee base directory, config directory and repository directory
     $this->container->setParameter('bbapp.base.dir', $this->application->getBBDir());
     $this->container->setParameter('bbapp.config.dir', $this->application->getConfigDir());
     $this->container->setParameter('bbapp.repository.dir', $this->application->getRepository());
     // set default cache directory and cache autogenerate value
     $cache_directory = $this->application->getBaseDir() . DIRECTORY_SEPARATOR . self::CACHE_FOLDER_NAME;
     if (ApplicationInterface::DEFAULT_ENVIRONMENT !== $this->environment) {
         $cache_directory .= DIRECTORY_SEPARATOR . $this->environment;
     }
     $this->container->setParameter('bbapp.cache.dir', $cache_directory);
     $this->container->setParameter('bbapp.cache.autogenerate', '%container.autogenerate%');
     // define log directory
     $this->container->setParameter('bbapp.log.dir', $this->application->getBaseDir() . DIRECTORY_SEPARATOR . self::LOG_FOLDER_NAME);
     // define data directory
     $this->container->setParameter('bbapp.data.dir', $this->application->getRepository() . DIRECTORY_SEPARATOR . self::DATA_FOLDER_NAME);
     // define media directory
     $this->container->setParameter('bbapp.media.dir', $this->container->getParameter('bbapp.data.dir') . DIRECTORY_SEPARATOR . self::MEDIA_FOLDER_NAME);
 }