diff --git a/PHPCI/Plugin/Shell.php b/PHPCI/Plugin/Shell.php new file mode 100644 index 00000000..602824ec --- /dev/null +++ b/PHPCI/Plugin/Shell.php @@ -0,0 +1,48 @@ + +* @package PHPCI +* @subpackage Plugins +*/ +class Shell implements \PHPCI\Plugin +{ + protected $args; + protected $phpci; + + /** + * @var string $command The command to be executed + */ + protected $command; + + public function __construct(\PHPCI\Builder $phpci, array $options = array()) + { + $this->phpci = $phpci; + + if (isset($options['command'])) { + $command = $options['command']; + $command = str_replace("%buildpath%", $this->phpci->buildPath, $command); + $this->command = $command; + } + } + + /** + * Runs the shell command. + */ + public function execute() + { + $success = $this->phpci->executeCommand($this->command); + + return $success; + } +}