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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to