Development

Changeset 7669

You must first sign up to be able to contribute.

Changeset 7669

Show
Ignore:
Timestamp:
02/28/08 13:39:12 (6 months ago)
Author:
fabien
Message:

fixed propel:build-all-load task

Files:

Legend:

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

    r7400 r7669  
    3030    )); 
    3131 
     32    $this->addOptions(array( 
     33      new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'), 
     34      new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'propel'), 
     35    )); 
     36 
    3237    $this->aliases = array('propel-build-all-load'); 
    3338    $this->namespace = 'propel'; 
     
    5560  protected function execute($arguments = array(), $options = array()) 
    5661  { 
     62    // load Propel configuration before Phing 
     63    $configuration = sfApplicationConfiguration::getForApplication($arguments['application'], $options['env'], true); 
     64    $databaseManager = new sfDatabaseManager($configuration); 
     65    require_once sfConfig::get('sf_symfony_lib_dir').'/plugins/sfPropelPlugin/lib/propel/sfPropelAutoload.php'; 
     66 
    5767    $buildAll = new sfPropelBuildAllTask($this->dispatcher, $this->formatter); 
    5868    $buildAll->setCommandApplication($this->commandApplication); 
     
    6171    $loadData = new sfPropelLoadDataTask($this->dispatcher, $this->formatter); 
    6272    $loadData->setCommandApplication($this->commandApplication); 
    63     $loadData->run(array('application' => $arguments['application'])); 
     73 
     74    $loadData->run(array('application' => $arguments['application']), array('--env='.$options['env'], '--connection='.$options['connection'])); 
    6475  } 
    6576}