mirror of https://github.com/hauke68/Magallanes
Browse Source
Tasks are aware if they are in rollbacks; they will be invoked only if they implement the new interface RollbackAware.1.0
Andrs Montaez
13 years ago
9 changed files with 70 additions and 23 deletions
@ -0,0 +1,4 @@
|
||||
<?php |
||||
interface Mage_Task_Releases_RollbackAware |
||||
{ |
||||
} |
@ -0,0 +1,14 @@
|
||||
<?php |
||||
class Task_SampleTask |
||||
extends Mage_Task_TaskAbstract |
||||
{ |
||||
public function getName() |
||||
{ |
||||
return 'A Sample Task'; |
||||
} |
||||
|
||||
public function run() |
||||
{ |
||||
return true; |
||||
} |
||||
} |
@ -0,0 +1,19 @@
|
||||
<?php |
||||
class Task_SampleTaskRollbackAware |
||||
extends Mage_Task_TaskAbstract |
||||
implements Mage_Task_Releases_RollbackAware |
||||
{ |
||||
public function getName() |
||||
{ |
||||
if ($this->inRollback()) { |
||||
return 'A Sample Task aware of rollbacks [in rollback]'; |
||||
} else { |
||||
return 'A Sample Task aware of rollbacks [not in rollback]'; |
||||
} |
||||
} |
||||
|
||||
public function run() |
||||
{ |
||||
return true; |
||||
} |
||||
} |
Loading…
Reference in new issue