/** * 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'); }
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; }
/** * 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); }
protected function initialize() { $this->context = dmContext::createInstance($this->configuration); $this->moduleManager = $this->context->getModuleManager(); }