You need to call the task with a specific application (either by adding --application=whatever to the calling code, or by specifying the default application in the respective parameter). Without that, you get a project config, with it, you get an application config. The reason is that many factories are defined on the application level, so sfContext needs those to be there.
Daniel On Mar 17, 1:57 pm, Philippe Mangé <phili...@magicmanage.be> wrote: > Hi all, > > I am having the following error: > > PHP Catchable fatal error: Argument 1 passed to > dmContext::createInstance() must be an instance of > sfApplicationConfiguration, instance of ProjectConfiguration given, > called in ... > > my code looks like this > Somebody an idea ? > > protected function execute($arguments = array(), $options = array()) > { > // initialize the database connection > $databaseManager = new sfDatabaseManager($this->configuration); > $connection = $databaseManager- > > >getDatabase($options['connection'] ? $options['connection'] : null)- > >getConnection(); > > // create a context, and load the helper > $context = dmContext::createInstance($this->configuration); > $this->configuration->loadHelpers('Partial'); > > // create the message > $message = $this->getMailer()->compose('*****@****', '*********', > 'Subject Line'); > > // generate HTML part > $context->getRequest()->setRequestFormat('html'); > $html = 'test'; > $message->setBody($html, 'text/html'); > > // generate plain text part > $context->getRequest()->setRequestFormat('txt'); > $plain = 'test'; > $message->addPart($plain, 'text/plain'); > > // send the message > $this->getMailer()->send($message); > > } -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en