Changeset 8417
- Timestamp:
- 04/11/08 16:14:23 (1 year ago)
- Files:
-
- branches/1.1/lib/config/sfGeneratorConfigHandler.class.php (modified) (1 diff)
- branches/1.1/lib/config/sfProjectConfiguration.class.php (modified) (1 diff)
- branches/1.1/lib/plugins/sfPropelPlugin/test/functional/backendTestBrowser.class.php (modified) (1 diff)
- branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/backend/config/settings.yml (modified) (1 diff)
- branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/crud/config/settings.yml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/config/sfGeneratorConfigHandler.class.php
r7827 r8417 69 69 $generatorParam['moduleName'] = $match[1]; 70 70 71 $data = $generatorManager->generate($config['class'], $generatorParam);72 73 71 // compile data 74 72 $retval = "<?php\n". 75 73 "// auto-generated by sfGeneratorConfigHandler\n". 76 74 "// date: %s\n%s\n"; 77 $retval = sprintf($retval, date('Y/m/d H:i:s'), $ data);75 $retval = sprintf($retval, date('Y/m/d H:i:s'), $this->getContent($generatorManager, $config['class'], $generatorParam)); 78 76 79 77 return $retval; 78 } 79 80 static public function getContent(sfGeneratorManager $generatorManager, $class, $parameters) 81 { 82 $data = ''; 83 84 // TODO: remove when the admin generator is moved to the new form framework 85 $r = new ReflectionClass($class); 86 if ('sfPropelAdminGenerator' == $class || $r->isSubclassOf(new ReflectionClass('sfPropelAdminGenerator'))) 87 { 88 $data .= <<<EOF 89 sfConfig::set('sf_compat_10', true); 90 require sfConfig::get('sf_symfony_lib_dir').'/plugins/sfCompat10Plugin/config/config.php'; 91 92 EOF; 93 } 94 95 $data .= $generatorManager->generate($class, $parameters); 96 97 return $data; 80 98 } 81 99 branches/1.1/lib/config/sfProjectConfiguration.class.php
r8290 r8417 31 31 public function __construct($rootDir = null, sfEventDispatcher $dispatcher = null) 32 32 { 33 sfProjectConfiguration::$active = $this; 33 if (is_null(sfProjectConfiguration::$active) || $this instanceof sfApplicationConfiguration) 34 { 35 sfProjectConfiguration::$active = $this; 36 } 37 34 38 $this->rootDir = is_null($rootDir) ? self::guessRootDir() : realpath($rootDir); 35 39 branches/1.1/lib/plugins/sfPropelPlugin/test/functional/backendTestBrowser.class.php
r7614 r8417 51 51 mkdir(sfConfig::get('sf_config_cache_dir'), 0777); 52 52 } 53 file_put_contents(sprintf('%s/modules_%s_config_generator.yml.php', sfConfig::get('sf_config_cache_dir'), $this->moduleName), '<?php '. $generatorManager->generate('sfPropelAdminGenerator', $params));53 file_put_contents(sprintf('%s/modules_%s_config_generator.yml.php', sfConfig::get('sf_config_cache_dir'), $this->moduleName), '<?php '.sfGeneratorConfigHandler::getContent($generatorManager, 'sfPropelAdminGenerator', $params)); 54 54 55 55 return $this; branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/backend/config/settings.yml
r6609 r8417 22 22 etag: off 23 23 24 all: 25 .settings: 26 compat_10: on 24 #all: 27 25 # .actions: 28 26 # default_module: default branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/crud/config/settings.yml
r6609 r8417 22 22 etag: off 23 23 24 all: 25 .settings: 26 compat_10: on 24 #all: 27 25 # .actions: 28 26 # default_module: default

