From: Rotem Liss Date: Sun, 6 Jul 2008 11:12:02 +0000 (+0000) Subject: Show extension name only if its checks are not empty. X-Git-Tag: 1.31.0-rc.0~46699 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=9f51078f62bfa3b4997cadb77c48d0b23da67cb8;p=lhc%2Fweb%2Fwiklou.git Show extension name only if its checks are not empty. --- diff --git a/maintenance/language/checkLanguage.inc b/maintenance/language/checkLanguage.inc index 5681459033..baa96196a6 100644 --- a/maintenance/language/checkLanguage.inc +++ b/maintenance/language/checkLanguage.inc @@ -305,6 +305,22 @@ $detailText EOL; } + + protected function isEmpty() { + $empty = true; + foreach( $this->results as $code => $results ) { + foreach( $results as $check => $messages ) { + if( !empty( $messages ) ) { + $empty = false; + break; + } + } + if( !$empty ) { + break; + } + } + return $empty; + } } class CheckExtensionsCLI extends CheckLanguageCLI { @@ -422,26 +438,28 @@ ENDS; protected function checkLanguage( $code ) { foreach( $this->extensions as $extension ) { - echo $extension->name() . ":\n"; - $this->L = $extension; $this->results = array(); $this->results[$code] = parent::checkLanguage( $code ); - if( $this->level > 0 ) { - switch( $this->output ) { - case 'plain': - $this->outputText(); - break; - case 'wiki': - $this->outputWiki(); - break; - default: - throw new MWException( "Invalid output type $this->output" ); + if( !$this->isEmpty() ) { + echo $extension->name() . ":\n"; + + if( $this->level > 0 ) { + switch( $this->output ) { + case 'plain': + $this->outputText(); + break; + case 'wiki': + $this->outputWiki(); + break; + default: + throw new MWException( "Invalid output type $this->output" ); + } } - } - echo "\n"; + echo "\n"; + } } } }