From 2672908225679aeefb3cba8a1ba353c12e9face7 Mon Sep 17 00:00:00 2001 From: mulleto Date: Fri, 29 May 2015 08:26:47 +0200 Subject: [PATCH] Make check for Pdepend output dir more robust. Before this fix, the pdepend module would check for "is_writable", which returns false even when the directory does not exist. I suggest to a) attempt to crete the dir if it does not exist, and b) make the error message more explanatory in case the dir cannot be created or is not accessible. --- PHPCI/Plugin/Pdepend.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PHPCI/Plugin/Pdepend.php b/PHPCI/Plugin/Pdepend.php index 73b669c1..faef406d 100644 --- a/PHPCI/Plugin/Pdepend.php +++ b/PHPCI/Plugin/Pdepend.php @@ -73,8 +73,11 @@ class Pdepend implements \PHPCI\Plugin */ public function execute() { + if (!file_exists($this->location)) { + mkdir($this->location); + } if (!is_writable($this->location)) { - throw new \Exception(sprintf('The location %s is not writable.', $this->location)); + throw new \Exception(sprintf('The location %s is not writable or does not exist.', $this->location)); } $pdepend = $this->phpci->findBinary('pdepend');