In principle you should be able to hook the command.post_command event
to call a second task after a particular task executes.
In practice, to instantiate a task you need the dispatcher, formatter,
command application and configuration.
The code ought to look like this:
$this->dispatcher->connect('command.post_command', array($this,
'listenToCommandPostCommandEvent'));
...
$task = $event->getSubject();
if ($task->getFullName() === 'doctrine:data-load')
{
echo("Running after-fixtures\n");
$subtask = new afterFixturesTask($task->getDispatcher(),
$task->getFormatter());
$subtask->setCommandApplication($task->getCommandApplication());
$subtask->setConfiguration($task->getConfiguration());
$ret = $subtask->run();
}
But in actuality the dispatcher, command application and configuration
are protected and have no getters in sfTask. So even though I am in
effect subclassing an existing task, I don't have access to the
properties I need to do that.
My proposal is that public getters be added for these properties so
that you can take advantage of command.post_command and
command.pre_command to enhance tasks by triggering others.
--
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com
--
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 developers" 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-devs?hl=en