r60580 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60579‎ | r60580 | r60581 >
Date:15:02, 3 January 2010
Author:ialex
Status:ok
Tags:
Comment:
Let's use the variables introduced in r59758 :)
Modified paths:
  • /trunk/phase3/maintenance/syntaxChecker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/syntaxChecker.php
@@ -159,9 +159,16 @@
160160 /**
161161 * Returns true if $file is of a type we can check
162162 */
163 - private static function isSuitableFile( $file ) {
 163+ private function isSuitableFile( $file ) {
164164 $ext = pathinfo( $file, PATHINFO_EXTENSION );
165 - return $ext == 'php' || $ext == 'inc' || $ext == 'php5';
 165+ if ( $ext != 'php' && $ext != 'inc' && $ext != 'php5' )
 166+ return false;
 167+ foreach( $this->mIgnorePaths as $regex ) {
 168+ $m = array();
 169+ if ( preg_match( "~{$regex}~", $file, $m ) )
 170+ return false;
 171+ }
 172+ return true;
166173 }
167174
168175 /**
@@ -197,7 +204,7 @@
198205 RecursiveIteratorIterator::SELF_FIRST
199206 );
200207 foreach ( $iterator as $file ) {
201 - if ( self::isSuitableFile( $file->getRealPath() ) ) {
 208+ if ( $this->isSuitableFile( $file->getRealPath() ) ) {
202209 $this->mFiles[] = $file->getRealPath();
203210 }
204211 }
@@ -255,6 +262,12 @@
256263 * @return boolean
257264 */
258265 private function checkForMistakes( $file ) {
 266+ foreach( $this->mNoStyleCheckPaths as $regex ) {
 267+ $m = array();
 268+ if ( preg_match( "~{$regex}~", $file, $m ) )
 269+ return;
 270+ }
 271+
259272 $text = file_get_contents( $file );
260273
261274 $this->checkRegex( $file, $text, '/^[\s\r\n]+<\?/', 'leading whitespace' );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r59758Updated links for pages moved from Meta to mw.org, tweaked doc a bit in one c...maxsem15:03, 5 December 2009

Status & tagging log