summaryrefslogtreecommitdiff
path: root/buildscripts/phing/tasks/PhpLintTask.php
diff options
context:
space:
mode:
authorknut <>2006-02-23 18:49:14 +0000
committerknut <>2006-02-23 18:49:14 +0000
commit790954df7b3959af479a71bae0905c1c11a56fb7 (patch)
tree1b75aad5ebfadcf82f95965447fbf56dc21867f8 /buildscripts/phing/tasks/PhpLintTask.php
parent088c6a09d6c1f230060e98ea98dcfb8f69025af6 (diff)
Created an XmlLintTask to validate configuration against XML Schema Definitions and a new target lint-demos to check both syntax of demo configuration and PHP source files
Diffstat (limited to 'buildscripts/phing/tasks/PhpLintTask.php')
-rw-r--r--buildscripts/phing/tasks/PhpLintTask.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/buildscripts/phing/tasks/PhpLintTask.php b/buildscripts/phing/tasks/PhpLintTask.php
index 63ae6dde..2fd89fc3 100644
--- a/buildscripts/phing/tasks/PhpLintTask.php
+++ b/buildscripts/phing/tasks/PhpLintTask.php
@@ -34,6 +34,10 @@ class PhpLintTask extends Task {
* Execute lint check against PhingFile or a FileSet
*/
public function main() {
+ if(!isset($this->file) and count($this->filesets) == 0) {
+ throw new BuildException("Missing either a nested fileset or attribute 'file' set");
+ }
+
if($this->file instanceof PhingFile) {
$this->lint($this->file->getPath());
} else { // process filesets
@@ -47,7 +51,6 @@ class PhpLintTask extends Task {
}
}
}
- $this->log('No syntax errors detected');
}
/**
@@ -63,7 +66,9 @@ class PhpLintTask extends Task {
$message = array();
exec($command.$file, $message);
if(!preg_match('/^No syntax errors detected/', $message[0])) {
- throw new BuildException($message[1]);
+ $this->log($message[1], PROJECT_MSG_ERR);
+ } else {
+ $this->log($file.': No syntax errors detected', PROJECT_MSG_INFO);
}
} else {
throw new BuildException('Permission denied: '.$file);