1
0
mirror of https://github.com/hauke68/Magallanes.git synced 2025-09-13 20:50:18 +02:00
Magallanes/Mage/Task/TaskAbstract.php

40 lines
1.0 KiB
PHP
Raw Normal View History

<?php
abstract class Mage_Task_TaskAbstract
{
protected $_config = null;
protected $_inRollback = false;
public abstract function getName();
public abstract function run();
public final function __construct(Mage_Config $config, $inRollback = false)
{
$this->_config = $config;
$this->_inRollback = $inRollback;
}
public function inRollback()
{
return $this->_inRollback;
}
public function init()
{
}
2012-01-01 16:36:41 +01:00
protected final function _runLocalCommand($command, &$output = null)
{
2012-01-01 16:36:41 +01:00
return Mage_Console::executeCommand($command, $output);
}
2012-01-01 16:36:41 +01:00
protected final function _runRemoteCommand($command, &$output = null)
{
$localCommand = 'ssh '
. $this->_config->deployment('user') . '@' . $this->_config->getHost() . ' '
. '"cd ' . $this->_config->deployment('to') . ' && '
. $command . '"';
2012-01-01 16:36:41 +01:00
return $this->_runLocalCommand($localCommand, $output);
}
}