Development

Changeset 8970

You must first sign up to be able to contribute.

Changeset 8970

Show
Ignore:
Timestamp:
05/15/08 05:59:27 (2 months ago)
Author:
Carl.Vondrick
Message:

1.1: added cli option to skip building forms when using propel:build-all[-load] tasks to avoid cluttering lib/form (closes #3420)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelBuildAllLoadTask.class.php

    r8491 r8970  
    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 
     
    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); 
  • branches/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelBuildAllTask.class.php

    r7400 r8970  
    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: 
     
    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);