From cd4e8648838598303549b44202a8f23de2ca5560 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 7 Aug 2009 04:29:04 +0000 Subject: [PATCH] Keep track of failures and tweak final output --- maintenance/syntaxChecker.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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" ); } } -- 2.20.1