/**
  * Initializes the current sfGenerator instance.
  *
  * @param sfGeneratorManager $generatorManager A sfGeneratorManager instance
  */
 public function initialize(sfGeneratorManager $generatorManager)
 {
     parent::initialize($generatorManager);
     if (!dmContext::hasInstance()) {
         dmContext::createInstance($generatorManager->getConfiguration());
     }
     $this->moduleManager = dmContext::getInstance()->getModuleManager();
     $this->setGeneratorClass('dmDoctrineForm');
 }
예제 #2
0
 public function boot($app = 'admin', $env = 'test', $debug = true)
 {
     $rootDir = getcwd();
     // configuration
     require_once $rootDir . '/config/ProjectConfiguration.class.php';
     $this->configuration = ProjectConfiguration::getApplicationConfiguration($app, $env, $debug, $rootDir);
     $this->context = dmContext::createInstance($this->configuration, null, $this->contextClass);
     sfConfig::set('sf_logging_enabled', false);
     // remove all cache
     sfToolkit::clearDirectory(sfConfig::get('sf_app_cache_dir'));
     $this->cleanup();
     $this->initialize();
     register_shutdown_function(array($this, 'cleanup'));
     return $this;
 }
예제 #3
0
파일: dmBase.php 프로젝트: rafaelgou/diem
 /**
  * All context creations are made here.
  * You can replace here the dmContext class by your own.
  */
 public static function createContext(sfApplicationConfiguration $configuration, $name = null, $class = 'dmContext')
 {
     return dmContext::createInstance($configuration, $name, $class);
 }
예제 #4
0
 protected function initialize()
 {
     $this->context = dmContext::createInstance($this->configuration);
     $this->moduleManager = $this->context->getModuleManager();
 }