Development

Changeset 11338

You must first sign up to be able to contribute.

Changeset 11338

Show
Ignore:
Timestamp:
09/06/08 08:30:45 (3 months ago)
Author:
fabien
Message:

[1.1, 1.2] fixed sfBaseTask so that it notifies the same event as sfTask

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/task/sfBaseTask.class.php

    r9664 r11338  
    2727  protected function doRun(sfCommandManager $commandManager, $options) 
    2828  { 
     29    $this->dispatcher->filter(new sfEvent($this, 'command.filter_options', array('command_manager' => $commandManager)), $options); 
     30 
    2931    $this->process($commandManager, $options); 
     32 
     33    $event = new sfEvent($this, 'command.pre_command', array('arguments' => $commandManager->getArgumentValues(), 'options' => $commandManager->getOptionValues())); 
     34    $this->dispatcher->notifyUntil($event); 
     35    if ($event->isProcessed()) 
     36    { 
     37      return $this->getReturnValue(); 
     38    } 
    3039 
    3140    $this->checkProjectExists(); 
     
    6675    } 
    6776 
    68     return $this->execute($commandManager->getArgumentValues(), $commandManager->getOptionValues()); 
     77    $ret = $this->execute($commandManager->getArgumentValues(), $commandManager->getOptionValues()); 
     78 
     79    $this->dispatcher->notify(new sfEvent($this, 'command.post_command')); 
     80 
     81    return $ret; 
    6982  } 
    7083 
  • branches/1.2/lib/task/sfBaseTask.class.php

    r11293 r11338  
    2727  protected function doRun(sfCommandManager $commandManager, $options) 
    2828  { 
     29    $this->dispatcher->filter(new sfEvent($this, 'command.filter_options', array('command_manager' => $commandManager)), $options); 
     30 
    2931    $this->process($commandManager, $options); 
     32 
     33    $event = new sfEvent($this, 'command.pre_command', array('arguments' => $commandManager->getArgumentValues(), 'options' => $commandManager->getOptionValues())); 
     34    $this->dispatcher->notifyUntil($event); 
     35    if ($event->isProcessed()) 
     36    { 
     37      return $this->getReturnValue(); 
     38    } 
    3039 
    3140    $this->checkProjectExists(); 
     
    8190    } 
    8291 
    83     return $this->execute($commandManager->getArgumentValues(), $commandManager->getOptionValues()); 
     92    $ret = $this->execute($commandManager->getArgumentValues(), $commandManager->getOptionValues()); 
     93 
     94    $this->dispatcher->notify(new sfEvent($this, 'command.post_command')); 
     95 
     96    return $ret; 
    8497  } 
    8598