From: Alexandre Emsenhuber Date: Sun, 3 Jan 2010 15:02:55 +0000 (+0000) Subject: Let's use the variables introduced in r59758 :) X-Git-Tag: 1.31.0-rc.0~38429 X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=commitdiff_plain;h=ca1cf181213379c57fb9084bb9b14dd8bc6041c0;p=lhc%2Fweb%2Fwiklou.git Let's use the variables introduced in r59758 :) --- diff --git a/maintenance/syntaxChecker.php b/maintenance/syntaxChecker.php index 732bc649ed..f5c83ac341 100644 --- a/maintenance/syntaxChecker.php +++ b/maintenance/syntaxChecker.php @@ -159,9 +159,16 @@ class SyntaxChecker extends Maintenance { /** * Returns true if $file is of a type we can check */ - private static function isSuitableFile( $file ) { + private function isSuitableFile( $file ) { $ext = pathinfo( $file, PATHINFO_EXTENSION ); - return $ext == 'php' || $ext == 'inc' || $ext == 'php5'; + if ( $ext != 'php' && $ext != 'inc' && $ext != 'php5' ) + return false; + foreach( $this->mIgnorePaths as $regex ) { + $m = array(); + if ( preg_match( "~{$regex}~", $file, $m ) ) + return false; + } + return true; } /** @@ -197,7 +204,7 @@ class SyntaxChecker extends Maintenance { RecursiveIteratorIterator::SELF_FIRST ); foreach ( $iterator as $file ) { - if ( self::isSuitableFile( $file->getRealPath() ) ) { + if ( $this->isSuitableFile( $file->getRealPath() ) ) { $this->mFiles[] = $file->getRealPath(); } } @@ -255,6 +262,12 @@ class SyntaxChecker extends Maintenance { * @return boolean */ private function checkForMistakes( $file ) { + foreach( $this->mNoStyleCheckPaths as $regex ) { + $m = array(); + if ( preg_match( "~{$regex}~", $file, $m ) ) + return; + } + $text = file_get_contents( $file ); $this->checkRegex( $file, $text, '/^[\s\r\n]+<\?/', 'leading whitespace' );