X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=blobdiff_plain;f=includes%2Finstaller%2FInstaller.php;h=7cfc6173333c97425272f96b2f01f35510accde8;hb=d13aa39760f9de5ab9c638ae417f94c786244ee7;hp=439b370ce2ad09a2ea306b3c4f21431144029e4f;hpb=a4746650a35cd36006f424d7928c55dd723272ff;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 439b370ce2..7cfc617333 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -24,6 +24,7 @@ * @ingroup Deployment */ use MediaWiki\MediaWikiServices; +use MediaWiki\Shell\Shell; /** * This documentation group collects source code files with deployment functionality. @@ -445,7 +446,6 @@ abstract class Installer { $this->parserTitle = Title::newFromText( 'Installer' ); $this->parserOptions = new ParserOptions( $wgUser ); // language will be wrong :( - $this->parserOptions->setEditSection( false ); // Don't try to access DB before user language is initialised $this->setParserLanguage( Language::factory( 'en' ) ); } @@ -598,9 +598,9 @@ abstract class Installer { // phpcs:ignore MediaWiki.VariableAnalysis.UnusedGlobalVariables global $wgExtensionDirectory, $wgStyleDirectory; - MediaWiki\suppressWarnings(); + Wikimedia\suppressWarnings(); $_lsExists = file_exists( "$IP/LocalSettings.php" ); - MediaWiki\restoreWarnings(); + Wikimedia\restoreWarnings(); if ( !$_lsExists ) { return false; @@ -805,14 +805,14 @@ abstract class Installer { * @return bool */ protected function envCheckPCRE() { - MediaWiki\suppressWarnings(); + Wikimedia\suppressWarnings(); $regexd = preg_replace( '/[\x{0430}-\x{04FF}]/iu', '', '-АБВГД-' ); // Need to check for \p support too, as PCRE can be compiled // with utf8 support, but not unicode property support. // check that \p{Zs} (space separators) matches // U+3000 (Ideographic space) $regexprop = preg_replace( '/\p{Zs}/u', '', "-\xE3\x80\x80-" ); - MediaWiki\restoreWarnings(); + Wikimedia\restoreWarnings(); if ( $regexd != '--' || $regexprop != '--' ) { $this->showError( 'config-pcre-no-utf8' ); @@ -991,17 +991,17 @@ abstract class Installer { } # Get a list of available locales. - $ret = false; - $lines = wfShellExec( '/usr/bin/locale -a', $ret ); + $result = Shell::command( '/usr/bin/locale', '-a' ) + ->execute(); - if ( $ret ) { + if ( $result->getExitCode() != 0 ) { return true; } + $lines = $result->getStdout(); $lines = array_map( 'trim', explode( "\n", $lines ) ); $candidatesByLocale = []; $candidatesByLang = []; - foreach ( $lines as $line ) { if ( $line === '' ) { continue; @@ -1205,7 +1205,7 @@ abstract class Installer { // it would be good to check other popular languages here, but it'll be slow. - MediaWiki\suppressWarnings(); + Wikimedia\suppressWarnings(); foreach ( $scriptTypes as $ext => $contents ) { foreach ( $contents as $source ) { @@ -1224,14 +1224,14 @@ abstract class Installer { unlink( $dir . $file ); if ( $text == 'exec' ) { - MediaWiki\restoreWarnings(); + Wikimedia\restoreWarnings(); return $ext; } } } - MediaWiki\restoreWarnings(); + Wikimedia\restoreWarnings(); return false; } @@ -1564,7 +1564,7 @@ abstract class Installer { $user->saveSettings(); // Update user count - $ssUpdate = new SiteStatsUpdate( 0, 0, 0, 0, 1 ); + $ssUpdate = SiteStatsUpdate::factory( [ 'users' => 1 ] ); $ssUpdate->doUpdate(); } $status = Status::newGood(); @@ -1700,8 +1700,8 @@ abstract class Installer { * Some long-running pages (Install, Upgrade) will want to do this */ protected function disableTimeLimit() { - MediaWiki\suppressWarnings(); + Wikimedia\suppressWarnings(); set_time_limit( 0 ); - MediaWiki\restoreWarnings(); + Wikimedia\restoreWarnings(); } }