Index: trunk/phase3/maintenance/language/checkLanguage.inc |
— | — | @@ -305,6 +305,22 @@ |
306 | 306 | |
307 | 307 | EOL; |
308 | 308 | } |
| 309 | + |
| 310 | + protected function isEmpty() { |
| 311 | + $empty = true; |
| 312 | + foreach( $this->results as $code => $results ) { |
| 313 | + foreach( $results as $check => $messages ) { |
| 314 | + if( !empty( $messages ) ) { |
| 315 | + $empty = false; |
| 316 | + break; |
| 317 | + } |
| 318 | + } |
| 319 | + if( !$empty ) { |
| 320 | + break; |
| 321 | + } |
| 322 | + } |
| 323 | + return $empty; |
| 324 | + } |
309 | 325 | } |
310 | 326 | |
311 | 327 | class CheckExtensionsCLI extends CheckLanguageCLI { |
— | — | @@ -422,26 +438,28 @@ |
423 | 439 | |
424 | 440 | protected function checkLanguage( $code ) { |
425 | 441 | foreach( $this->extensions as $extension ) { |
426 | | - echo $extension->name() . ":\n"; |
427 | | - |
428 | 442 | $this->L = $extension; |
429 | 443 | $this->results = array(); |
430 | 444 | $this->results[$code] = parent::checkLanguage( $code ); |
431 | 445 | |
432 | | - if( $this->level > 0 ) { |
433 | | - switch( $this->output ) { |
434 | | - case 'plain': |
435 | | - $this->outputText(); |
436 | | - break; |
437 | | - case 'wiki': |
438 | | - $this->outputWiki(); |
439 | | - break; |
440 | | - default: |
441 | | - throw new MWException( "Invalid output type $this->output" ); |
| 446 | + if( !$this->isEmpty() ) { |
| 447 | + echo $extension->name() . ":\n"; |
| 448 | + |
| 449 | + if( $this->level > 0 ) { |
| 450 | + switch( $this->output ) { |
| 451 | + case 'plain': |
| 452 | + $this->outputText(); |
| 453 | + break; |
| 454 | + case 'wiki': |
| 455 | + $this->outputWiki(); |
| 456 | + break; |
| 457 | + default: |
| 458 | + throw new MWException( "Invalid output type $this->output" ); |
| 459 | + } |
442 | 460 | } |
| 461 | + |
| 462 | + echo "\n"; |
443 | 463 | } |
444 | | - |
445 | | - echo "\n"; |
446 | 464 | } |
447 | 465 | } |
448 | 466 | } |