Development

Changeset 12096

You must first sign up to be able to contribute.

Changeset 12096

Show
Ignore:
Timestamp:
10/09/08 07:09:14 (6 years ago)
Author:
fabien
Message:

[1.2] fixed doctrine:init-admin won't work without sfPropelPlugin (closes #4541)

Files:

Legend:

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

    r11644 r12096  
    7373              "// auto-generated by sfGeneratorConfigHandler\n". 
    7474              "// date: %s\n%s\n"; 
    75     $retval = sprintf($retval, date('Y/m/d H:i:s'), $this->getContent($generatorManager, $config['class'], $generatorParam)); 
     75    $retval = sprintf($retval, date('Y/m/d H:i:s'), self::getContent($generatorManager, $config['class'], $generatorParam)); 
    7676 
    7777    return $retval; 
     
    8383 
    8484    // TODO: remove when the admin generator is moved to the new form framework 
     85    $plugins = $generatorManager->getConfiguration()->getPlugins(); 
    8586    $r = new ReflectionClass($class); 
    86     if ('sfPropelAdminGenerator' == $class || $r->isSubclassOf(new ReflectionClass('sfPropelAdminGenerator'))) 
     87    if ( 
     88      (in_array('sfPropelPlugin', $plugins) && 'sfPropelAdminGenerator' == $class || $r->isSubclassOf(new ReflectionClass('sfPropelAdminGenerator'))) 
     89      || 
     90      (in_array('sfDoctrinePlugin', $plugins) && 'sfDoctrineAdminGenerator' == $class || $r->isSubclassOf(new ReflectionClass('sfDoctrineAdminGenerator'))) 
     91    ) 
    8792    { 
    88       $data .= <<<EOF 
    89 require sfConfig::get('sf_symfony_lib_dir').'/plugins/sfCompat10Plugin/config/config.php'; 
    90  
    91 EOF; 
     93      $data .= "require sfConfig::get('sf_symfony_lib_dir').'/plugins/sfCompat10Plugin/config/config.php';\n"; 
    9294    } 
    9395