ScannerModule(); } function preScan( $filename ) { parent::preScan( $filename ); $output = array(); exec( "php -l '$filename' 2>/dev/null", $output, $result ); if( $result != 0 ) { $file = file( $filename ); foreach( $output as $linterror ) { $matches = array(); if( preg_match( '/error:.*?on line (\d+)$/i', $linterror, $matches ) == 0 ) { continue; } $this->fault( array( 'file' => $filename, 'line' => $matches[1], 'context' => $file[$matches[1] - 1] ), FAULT_MAJOR, $linterror ); } } } } addModule( new LintModule() ); ?>