1
0
mirror of https://github.com/hauke68/Magallanes.git synced 2025-08-25 21:00:18 +02:00
Magallanes/Mage/Task/TaskAbstract.php
Andrs Montaez 9c03ae6bed Changes on configuration.
Preparation for Post Release tasks.
2011-11-28 00:41:53 -02:00

33 lines
840 B
PHP

<?php
abstract class Mage_Task_TaskAbstract
{
protected $_config = null;
public abstract function getName();
public abstract function run();
public final function __construct($config)
{
$this->_config = $config;
}
public function init()
{
}
protected final function _runLocalCommand($command)
{
return Mage_Console::executeCommand($command);
}
protected final function _runRemoteCommand($command)
{
$localCommand = 'ssh '
. $this->_config['deploy']['deployment']['user'] . '@' . $this->_config['deploy']['host'] . ' '
. '"cd ' . $this->_config['deploy']['deployment']['to'] . ' && '
. $command . '"';
return $this->_runLocalCommand($localCommand);
}
}