X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Finstaller%2FCliInstaller.php;h=c008333e473791422b7d36d79004a80165706a74;hp=f59b5da3ad67be91a5ab72570d962287fa2d64b3;hb=a469e81971a11b931716897d65e1fa3fdfe378e2;hpb=00b8238613d1a1123e0991efe6053a03cc1c7b76 diff --git a/includes/installer/CliInstaller.php b/includes/installer/CliInstaller.php index f59b5da3ad..c008333e47 100644 --- a/includes/installer/CliInstaller.php +++ b/includes/installer/CliInstaller.php @@ -72,6 +72,7 @@ class CliInstaller extends Installer { global $wgLang, $wgLanguageCode; $this->setVar( '_UserLang', $options['lang'] ); $wgLanguageCode = $options['lang']; + $this->setVar( 'wgLanguageCode', $wgLanguageCode ); $wgContLang = MediaWikiServices::getInstance()->getContentLanguage(); $wgLang = Language::factory( $options['lang'] ); RequestContext::getMain()->setLanguage( $wgLang ); @@ -199,24 +200,23 @@ class CliInstaller extends Installer { $this->showMessage( 'config-install-step-done' ); } - public function showMessage( $msg /*, ... */ ) { - echo $this->getMessageText( func_get_args() ) . "\n"; + public function showMessage( $msg, ...$params ) { + echo $this->getMessageText( $msg, $params ) . "\n"; flush(); } - public function showError( $msg /*, ... */ ) { - echo "***{$this->getMessageText( func_get_args() )}***\n"; + public function showError( $msg, ...$params ) { + echo "***{$this->getMessageText( $msg, $params )}***\n"; flush(); } /** + * @param string $msg * @param array $params * * @return string */ - protected function getMessageText( $params ) { - $msg = array_shift( $params ); - + protected function getMessageText( $msg, $params ) { $text = wfMessage( $msg, $params )->parse(); $text = preg_replace( '/(.*?)<\/a>/', '$2 <$1>', $text );