Clear
This commit is contained in:
parent
d29b9dc796
commit
47892bb7b0
|
@ -15,7 +15,6 @@ use PHPCI\Model\Build;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shell Plugin - Allows execute shell commands.
|
* Shell Plugin - Allows execute shell commands.
|
||||||
*
|
|
||||||
* @author Kinn Coelho Julião <kinncj@gmail.com>
|
* @author Kinn Coelho Julião <kinncj@gmail.com>
|
||||||
* @package PHPCI
|
* @package PHPCI
|
||||||
* @subpackage Plugins
|
* @subpackage Plugins
|
||||||
|
@ -60,7 +59,6 @@ class Shell implements \PHPCI\Plugin
|
||||||
// Keeping this for backwards compatibility, new projects should use interpolation vars.
|
// Keeping this for backwards compatibility, new projects should use interpolation vars.
|
||||||
$options['command'] = str_replace("%buildpath%", $this->phpci->buildPath, $options['command']);
|
$options['command'] = str_replace("%buildpath%", $this->phpci->buildPath, $options['command']);
|
||||||
$this->commands = array($options['command']);
|
$this->commands = array($options['command']);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,79 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* PHPCI - Continuous Integration for PHP
|
|
||||||
*
|
|
||||||
* @copyright Copyright 2014, Block 8 Limited.
|
|
||||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
|
||||||
* @link https://www.phptesting.org/
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace PHPCI\Plugin;
|
|
||||||
|
|
||||||
use PHPCI\Builder;
|
|
||||||
use PHPCI\Helper\Lang;
|
|
||||||
use PHPCI\Model\Build;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shell Plugin - Allows execute shell commands.
|
|
||||||
*
|
|
||||||
* @author Kinn Coelho Julião <kinncj@gmail.com>
|
|
||||||
* @package PHPCI
|
|
||||||
* @subpackage Plugins
|
|
||||||
*/
|
|
||||||
class Shell2 implements \PHPCI\Plugin
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var \PHPCI\Builder
|
|
||||||
*/
|
|
||||||
protected $phpci;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var \PHPCI\Model\Build
|
|
||||||
*/
|
|
||||||
protected $build;
|
|
||||||
|
|
||||||
protected $args;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string[] $commands The commands to be executed
|
|
||||||
*/
|
|
||||||
protected $command;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Standard Constructor
|
|
||||||
*
|
|
||||||
* $options['directory'] Output Directory. Default: %BUILDPATH%
|
|
||||||
* $options['filename'] Phar Filename. Default: build.phar
|
|
||||||
* $options['regexp'] Regular Expression Filename Capture. Default: /\.php$/
|
|
||||||
* $options['stub'] Stub Content. No Default Value
|
|
||||||
*
|
|
||||||
* @param Builder $phpci
|
|
||||||
* @param Build $build
|
|
||||||
* @param array $options
|
|
||||||
*/
|
|
||||||
public function __construct(Builder $phpci, Build $build, array $options = array())
|
|
||||||
{
|
|
||||||
$this->phpci = $phpci;
|
|
||||||
$this->build = $build;
|
|
||||||
|
|
||||||
if (isset($options['command'])) {
|
|
||||||
// Keeping this for backwards compatibility, new projects should use interpolation vars.
|
|
||||||
$options['command'] = str_replace("%buildpath%", $this->phpci->buildPath, $options['command']);
|
|
||||||
$this->command = $options['command'];
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs the shell command.
|
|
||||||
*/
|
|
||||||
public function execute()
|
|
||||||
{
|
|
||||||
if (!defined('ENABLE_SHELL_PLUGIN') || !ENABLE_SHELL_PLUGIN) {
|
|
||||||
throw new \Exception(Lang::get('shell_not_enabled'));
|
|
||||||
}
|
|
||||||
$success = exec("php -v");
|
|
||||||
return $success;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue