The generated task uses a connection name of propel. You will need to modify it to be the name of your connection.
- Jon On Tue, Jan 6, 2009 at 12:51 PM, Jeremy Benoist <[email protected]>wrote: > > Hi Tom, > > When I create a task, I always add thoses lines at the beginning of > execute function to get the doctrine connection : > > // initialize the database connection ($application, $env and $debug > come from $options) > $configuration = ProjectConfiguration::getApplicationConfiguration > ($application, $env, $debug); > // need to create a context, if not, we got an error : The "default" > context does not exist. > $context = sfContext::createInstance($configuration); > $databaseManager = new sfDatabaseManager($configuration); > > And then, I can use doctrine without any problem. > > J. > > On 6 jan, 18:19, "Tom Boutell" <[email protected]> wrote: > > I'm writing Symfony 1.2 tasks that use Doctrine. Doctrine is the only > > database present in the project, but the default database is still > > somehow Propel, resulting in a "Database 'propel' does not exist" > > error. I opened a case on it, check it for details before nitpicking > > my configuration (: > > > > http://trac.symfony-project.org/ticket/5549 > > > > Does anyone know how to convince Symfony that doctrine is the default > > database for use in command line tasks? > > > > Thanks! > > > > -- > > Tom Boutell > > > > www.punkave.comwww.boutell.com > > > -- Jonathan H. Wage Open Source Software Developer & Evangelist http://www.jwage.com http://www.doctrine-project.org http://www.symfony-project.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
