Development

Changeset 8417

You must first sign up to be able to contribute.

Changeset 8417

Show
Ignore:
Timestamp:
04/11/08 16:14:23 (1 year ago)
Author:
fabien
Message:

made admin generator work even if sf_compat is off (closes #3286)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/config/sfGeneratorConfigHandler.class.php

    r7827 r8417  
    6969    $generatorParam['moduleName'] = $match[1]; 
    7070 
    71     $data = $generatorManager->generate($config['class'], $generatorParam); 
    72  
    7371    // compile data 
    7472    $retval = "<?php\n". 
    7573              "// auto-generated by sfGeneratorConfigHandler\n". 
    7674              "// 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)); 
    7876 
    7977    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 
     89sfConfig::set('sf_compat_10', true); 
     90require sfConfig::get('sf_symfony_lib_dir').'/plugins/sfCompat10Plugin/config/config.php'; 
     91 
     92EOF; 
     93    } 
     94 
     95    $data .= $generatorManager->generate($class, $parameters); 
     96 
     97    return $data; 
    8098  } 
    8199 
  • branches/1.1/lib/config/sfProjectConfiguration.class.php

    r8290 r8417  
    3131  public function __construct($rootDir = null, sfEventDispatcher $dispatcher = null) 
    3232  { 
    33     sfProjectConfiguration::$active = $this; 
     33    if (is_null(sfProjectConfiguration::$active) || $this instanceof sfApplicationConfiguration) 
     34    { 
     35      sfProjectConfiguration::$active = $this; 
     36    } 
     37 
    3438    $this->rootDir = is_null($rootDir) ? self::guessRootDir() : realpath($rootDir); 
    3539 
  • branches/1.1/lib/plugins/sfPropelPlugin/test/functional/backendTestBrowser.class.php

    r7614 r8417  
    5151      mkdir(sfConfig::get('sf_config_cache_dir'), 0777); 
    5252    } 
    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)); 
    5454 
    5555    return $this; 
  • branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/backend/config/settings.yml

    r6609 r8417  
    2222    etag:                   off 
    2323 
    24 all: 
    25   .settings: 
    26     compat_10: on 
     24#all: 
    2725#  .actions: 
    2826#    default_module:         default 
  • branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/apps/crud/config/settings.yml

    r6609 r8417  
    2222    etag:                   off 
    2323 
    24 all: 
    25   .settings: 
    26     compat_10: on 
     24#all: 
    2725#  .actions: 
    2826#    default_module:         default 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.