From: Chad Horohoe Date: Fri, 7 Aug 2009 04:29:04 +0000 (+0000) Subject: Keep track of failures and tweak final output X-Git-Tag: 1.31.0-rc.0~40444 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=cd4e8648838598303549b44202a8f23de2ca5560;p=lhc%2Fweb%2Fwiklou.git Keep track of failures and tweak final output --- diff --git a/maintenance/syntaxChecker.php b/maintenance/syntaxChecker.php index 6a49395625..addc457ff4 100644 --- a/maintenance/syntaxChecker.php +++ b/maintenance/syntaxChecker.php @@ -25,7 +25,7 @@ require_once( dirname( __FILE__ ) . '/Maintenance.php' ); class SyntaxChecker extends Maintenance { // List of files we're going to check - private $mFiles = array(); + private $mFiles, $mFailures = array(); public function __construct() { parent::__construct(); @@ -79,16 +79,15 @@ class SyntaxChecker extends Maintenance { * Check the files for syntax errors */ private function checkSyntax() { - $count = $bad = 0; foreach( $this->mFiles as $f ) { - $count++; $res = exec( 'php -l ' . $f ); if( strpos( $res, 'No syntax errors detected' ) === false ) { - $bad++; + $this->mFailures[] = $f; $this->error( $res . "\n" ); } } - $this->output( "$count files checked, $bad failures\n" ); + $this->output( count($this->mFiles) . " files checked, " + . count($this->mFailures) . " failures\n" ); } }