Development

#5140: sfModelGenerator2.patch

You must first sign up to be able to contribute.

Ticket #5140: sfModelGenerator2.patch

File sfModelGenerator2.patch, 1.3 kB (added by DigitalBase, 1 year ago)

better patch ( a little nicer )

  • lib/generator/sfModelGenerator.class.php

    old new  
    167167    return implode(".'&", $params); 
    168168  } 
    169169 
    170   /**  
     170  /** 
    171171   * Configures this generator. 
    172172   */ 
    173173  abstract protected function configure(); 
     
    392392 
    393393    require_once $this->getGeneratorManager()->getBasePath().'/'.$basePath; 
    394394 
     395    $confclass = ucfirst($this->getModuleName()).'GeneratorConfiguration'; 
     396    $class = 'Base' . $confclass; 
     397 
    395398    $moduleDirs = array_keys($config->getControllerDirs($this->getModuleName())); 
    396     if (is_file($moduleDirs[0].'/../lib/configuration.php')) 
    397     { 
    398       require_once $moduleDirs[0].'/../lib/configuration.php'; 
    399       $class = $this->getModuleName().'GeneratorConfiguration'; 
     399    foreach ($moduleDirs as $moduleDir) { 
     400      if (is_file($moduleDir.'/../lib/' . $confclass. ".class.php")) 
     401      { 
     402        require_once $moduleDir.'/../lib/' . $confclass . ".class.php"; 
     403        $class = $confclass; 
     404        break; 
     405      } 
    400406    } 
    401     else 
    402     { 
    403       $class = 'Base'.ucfirst($this->getModuleName()).'GeneratorConfiguration'; 
    404     } 
    405407 
    406408    // validate configuration 
    407409    foreach ($this->config as $context => $value) 

The Sensio Labs Network

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