From 623bb18dd42fb3b1e8c1f2bda892f6d8b0dbb491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kinn=20Coelho=20Juli=C3=A3o?= Date: Fri, 17 May 2013 10:10:48 -0400 Subject: [PATCH] Added a Shell Plugin --- PHPCI/Plugin/Shell.php | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 PHPCI/Plugin/Shell.php 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; + } +}