Hi All
I try to run a task - but everytime i receive the follow error:
The "default" context does not exist.
I have no idea, how i could fix this problem. Anyone a idea?
My used code is:
<?php
class myMainTaskTask extends sfBaseTask
{
protected function configure()
{
// // add your own arguments here
// $this->addArguments(array(
// new sfCommandArgument('my_arg',
sfCommandArgument::REQUIRED,
'My argument'),
// ));
$this->addOptions(array(
new sfCommandOption('application', null,
sfCommandOption::PARAMETER_REQUIRED, 'The application name'),
new sfCommandOption('env', null,
sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),
new sfCommandOption('connection', null,
sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'propel'),
// add your own options here
));
$this->namespace = '';
$this->name = 'myMainTask';
$this->briefDescription = '';
$this->detailedDescription = <<<EOF
The [myMainTask|INFO] task does things.
Call it with:
[php symfony myMainTask|INFO]
EOF;
}
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();
$demo_accounts = DemoAccountPeer::doSelect(new Criteria());
}
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---