Merge pull request #350 from NamelessCoder/patch-6

Preserve absolute paths in Plugin.PhpMessDetector
This commit is contained in:
Steve B 2014-04-14 08:58:05 +01:00
commit 4b61d6b435

View file

@ -32,7 +32,8 @@ class PhpMessDetector implements \PHPCI\Plugin
/**
* @var string, based on the assumption the root may not hold the code to be
* tested, exteds the base path
* tested, exteds the base path only if the provided path is relative. Absolute
* paths are used verbatim
*/
protected $path;
@ -97,11 +98,16 @@ class PhpMessDetector implements \PHPCI\Plugin
$this->phpci->logFailure('Could not find phpmd.');
return false;
}
$path = $this->phpci->buildPath . $this->path;
if ($this->path{0} == '/') {
$path = $this->path;
}
$cmd = $phpmd . ' "%s" text %s %s %s';
$success = $this->phpci->executeCommand(
$cmd,
$this->phpci->buildPath . $this->path,
$path,
implode(',', $this->rules),
$ignore,
$suffixes