Development

#3420: propel-skip-forms.php.patch

You must first sign up to be able to contribute.

Ticket #3420: propel-skip-forms.php.patch

File propel-skip-forms.php.patch, 2.4 kB (added by Carl.Vondrick, 9 months ago)

possible patch

  • lib/task/sfPropelBuildAllLoadTask.class.php

    old new  
    3232    $this->addOptions(array( 
    3333      new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'), 
    3434      new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'propel'), 
     35      new sfCommandOption('skip-forms', 'F', sfCommandOption::PARAMETER_NONE, 'Skip generating forms') 
    3536    )); 
    3637 
    3738    $this->aliases = array('propel-build-all-load'); 
     
    6566 
    6667    $buildAll = new sfPropelBuildAllTask($this->dispatcher, $this->formatter); 
    6768    $buildAll->setCommandApplication($this->commandApplication); 
    68     $buildAll->run(); 
     69    $buildAll->run(array(), $options['skip-forms'] ? array('--skip-forms') : array()); 
    6970 
    7071    $loadData = new sfPropelLoadDataTask($this->dispatcher, $this->formatter); 
    7172    $loadData->setCommandApplication($this->commandApplication); 
  • lib/task/sfPropelBuildAllTask.class.php

    old new  
    3030    $this->name = 'build-all'; 
    3131    $this->briefDescription = 'Generates Propel model, SQL and initializes the database'; 
    3232 
     33    $this->addOptions(array( 
     34      new sfCommandOption('skip-forms', 'F', sfCommandOption::PARAMETER_NONE, 'Skip generating forms') 
     35    )); 
     36 
    3337    $this->detailedDescription = <<<EOF 
    3438The [propel:build-all|INFO] task is a shortcut for three other tasks: 
    3539 
     
    5963    $buildSql->setCommandApplication($this->commandApplication); 
    6064    $buildSql->run(); 
    6165 
    62     $buildForms = new sfPropelBuildFormsTask($this->dispatcher, $this->formatter); 
    63     $buildForms->setCommandApplication($this->commandApplication); 
    64     $buildForms->run(); 
     66    if (!$options['skip-forms']) 
     67    { 
     68      $buildForms = new sfPropelBuildFormsTask($this->dispatcher, $this->formatter); 
     69      $buildForms->setCommandApplication($this->commandApplication); 
     70      $buildForms->run(); 
     71    } 
    6572 
    6673    $insertSql = new sfPropelInsertSqlTask($this->dispatcher, $this->formatter); 
    6774    $insertSql->setCommandApplication($this->commandApplication);