Added param 'priority_path' (For all plugins) for control paths priority when we search plugin binary. Issue #104.

This commit is contained in:
Dmitry Khomutov 2017-07-19 10:26:51 +07:00
commit 59837a8ff1
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
27 changed files with 164 additions and 94 deletions

View file

@ -49,7 +49,7 @@ class Atoum extends Plugin
if (isset($options['executable'])) {
$this->executable = $this->builder->buildPath . DIRECTORY_SEPARATOR.$options['executable'];
} else {
$this->executable = $this->builder->findBinary('atoum');
$this->executable = $this->findBinary('atoum');
}
if (isset($options['args'])) {

View file

@ -37,7 +37,7 @@ class Behat extends Plugin
if (isset($options['executable'])) {
$this->executable = $options['executable'];
} else {
$this->executable = $this->builder->findBinary('behat');
$this->executable = $this->findBinary('behat');
}
if (!empty($options['features'])) {

View file

@ -114,7 +114,7 @@ class Codeception extends Plugin implements ZeroConfigPluginInterface
*/
protected function runConfigFile($configPath)
{
$codeception = $this->builder->findBinary('codecept');
$codeception = $this->findBinary('codecept');
if (!$codeception) {
$this->builder->logFailure(sprintf('Could not find %s', 'codecept'));

View file

@ -94,7 +94,7 @@ class Composer extends Plugin implements ZeroConfigPluginInterface
*/
public function execute()
{
$composerLocation = $this->builder->findBinary(['composer', 'composer.phar']);
$composerLocation = $this->findBinary(['composer', 'composer.phar']);
$cmd = $composerLocation . ' --no-ansi --no-interaction ';
if ($this->preferDist) {

View file

@ -37,7 +37,7 @@ class Grunt extends Plugin
$path = $this->builder->buildPath;
$this->directory = $path;
$this->task = null;
$this->grunt = $this->builder->findBinary('grunt');
$this->grunt = $this->findBinary('grunt');
$this->gruntfile = 'Gruntfile.js';
// Handle options:

View file

@ -37,7 +37,7 @@ class Gulp extends Plugin
$path = $this->builder->buildPath;
$this->directory = $path;
$this->task = null;
$this->gulp = $this->builder->findBinary('gulp');
$this->gulp = $this->findBinary('gulp');
$this->gulpfile = 'gulpfile.js';
// Handle options:

View file

@ -57,7 +57,7 @@ class Lint extends Plugin
$this->builder->quiet = true;
$success = true;
$php = $this->builder->findBinary('php');
$php = $this->findBinary('php');
foreach ($this->directories as $dir) {
if (!$this->lintDirectory($php, $dir)) {

View file

@ -77,7 +77,7 @@ class Pdepend extends Plugin
throw new \Exception(sprintf('The location %s is not writable or does not exist.', $this->location));
}
$pdepend = $this->builder->findBinary('pdepend');
$pdepend = $this->findBinary('pdepend');
$cmd = $pdepend . ' --summary-xml="%s" --jdepend-chart="%s" --overview-pyramid="%s" %s "%s"';

View file

@ -70,7 +70,7 @@ class Phing extends Plugin
*/
public function execute()
{
$phingExecutable = $this->builder->findBinary('phing');
$phingExecutable = $this->findBinary('phing');
$cmd[] = $phingExecutable . ' -f ' . $this->getBuildFilePath();

View file

@ -171,7 +171,7 @@ class PhpCodeSniffer extends Plugin implements ZeroConfigPluginInterface
{
list($ignore, $standard, $suffixes, $severity, $errorSeverity, $warningSeverity) = $this->getFlags();
$phpcs = $this->builder->findBinary('phpcs');
$phpcs = $this->findBinary('phpcs');
$this->builder->logExecOutput(false);

View file

@ -97,7 +97,7 @@ class PhpCpd extends Plugin implements ZeroConfigPluginInterface
$ignore = $ignore . $filesToIgnore;
}
$phpcpd = $this->builder->findBinary('phpcpd');
$phpcpd = $this->findBinary('phpcpd');
$tmpFileName = tempnam('/tmp', 'phpcpd');

View file

@ -89,7 +89,7 @@ class PhpCsFixer extends Plugin
$directory = '.';
}
$phpCsFixer = $this->builder->findBinary('php-cs-fixer');
$phpCsFixer = $this->findBinary('php-cs-fixer');
$cmd = $phpCsFixer . ' fix ' . $directory . ' %s';
$success = $this->builder->executeCommand($cmd, $this->args);

View file

@ -97,7 +97,7 @@ class PhpDocblockChecker extends Plugin implements ZeroConfigPluginInterface
public function execute()
{
// Check that the binary exists:
$checker = $this->builder->findBinary('phpdoccheck');
$checker = $this->findBinary('phpdoccheck');
// Build ignore string:
$ignore = '';

View file

@ -74,7 +74,7 @@ class PhpLoc extends Plugin implements ZeroConfigPluginInterface
$ignore = implode('', $ignore);
}
$phploc = $this->builder->findBinary('phploc');
$phploc = $this->findBinary('phploc');
$success = $this->builder->executeCommand($phploc . ' %s "%s"', $ignore, $this->directory);
$output = $this->builder->getLastOutput();

View file

@ -103,7 +103,7 @@ class PhpMessDetector extends Plugin implements ZeroConfigPluginInterface
return false;
}
$phpmdBinaryPath = $this->builder->findBinary('phpmd');
$phpmdBinaryPath = $this->findBinary('phpmd');
$this->executePhpMd($phpmdBinaryPath);

View file

@ -94,7 +94,7 @@ class PhpParallelLint extends Plugin implements ZeroConfigPluginInterface
{
list($ignore) = $this->getFlags();
$phplint = $this->builder->findBinary('parallel-lint');
$phplint = $this->findBinary('parallel-lint');
$cmd = $phplint . ' -e %s' . ' %s "%s"';
$success = $this->builder->executeCommand(

View file

@ -28,7 +28,7 @@ class PhpSpec extends Plugin
$curdir = getcwd();
chdir($this->builder->buildPath);
$phpspec = $this->builder->findBinary(['phpspec', 'phpspec.php']);
$phpspec = $this->findBinary(['phpspec', 'phpspec.php']);
$success = $this->builder->executeCommand($phpspec . ' --format=junit --no-code-generation run');
$output = $this->builder->getLastOutput();

View file

@ -119,7 +119,7 @@ class PhpUnit extends Plugin implements ZeroConfigPluginInterface
$options->removeArgument('configuration');
$arguments = $this->builder->interpolate($options->buildArgumentString());
$cmd = $this->builder->findBinary('phpunit') . ' %s "%s"';
$cmd = $this->findBinary('phpunit') . ' %s "%s"';
$success = $this->builder->executeCommand($cmd, $arguments, $directory);
$this->processResults($jsonFile);
@ -149,7 +149,7 @@ class PhpUnit extends Plugin implements ZeroConfigPluginInterface
$options->addArgument('configuration', $buildPath . $configFile);
$arguments = $this->builder->interpolate($options->buildArgumentString());
$cmd = $this->builder->findBinary('phpunit') . ' %s %s';
$cmd = $this->findBinary('phpunit') . ' %s %s';
$success = $this->builder->executeCommand($cmd, $arguments, $options->getTestsPath());
$this->processResults($jsonFile);

View file

@ -128,7 +128,7 @@ class XMPP extends Plugin
*/
public function execute()
{
$sendxmpp = $this->builder->findBinary('sendxmpp');
$sendxmpp = $this->findBinary('sendxmpp');
/*
* Without recipients we can't send notification