Merge "Fix ParserOutput::getText 'unwrap' flag for end-of-doc comment"
[lhc/web/wiklou.git] / includes / installer / Installer.php
index 46978e1..439b370 100644 (file)
@@ -243,7 +243,6 @@ abstract class Installer {
         * @var array
         */
        protected $objectCaches = [
-               'xcache' => 'xcache_get',
                'apc' => 'apc_fetch',
                'apcu' => 'apcu_fetch',
                'wincache' => 'wincache_ucache_get'
@@ -364,7 +363,7 @@ abstract class Installer {
 
                // disable (problematic) object cache types explicitly, preserving all other (working) ones
                // bug T113843
-               $emptyCache = [ 'class' => 'EmptyBagOStuff' ];
+               $emptyCache = [ 'class' => EmptyBagOStuff::class ];
 
                $objectCaches = [
                                CACHE_NONE => $emptyCache,
@@ -447,7 +446,6 @@ abstract class Installer {
                $this->parserTitle = Title::newFromText( 'Installer' );
                $this->parserOptions = new ParserOptions( $wgUser ); // language will be wrong :(
                $this->parserOptions->setEditSection( false );
-               $this->parserOptions->setWrapOutputClass( false );
                // Don't try to access DB before user language is initialised
                $this->setParserLanguage( Language::factory( 'en' ) );
        }
@@ -595,11 +593,10 @@ abstract class Installer {
                global $wgAutoloadClasses;
                $wgAutoloadClasses = [];
 
-               // @codingStandardsIgnoreStart
                // LocalSettings.php should not call functions, except wfLoadSkin/wfLoadExtensions
                // Define the required globals here, to ensure, the functions can do it work correctly.
+               // phpcs:ignore MediaWiki.VariableAnalysis.UnusedGlobalVariables
                global $wgExtensionDirectory, $wgStyleDirectory;
-               // @codingStandardsIgnoreEnd
 
                MediaWiki\suppressWarnings();
                $_lsExists = file_exists( "$IP/LocalSettings.php" );
@@ -690,13 +687,10 @@ abstract class Installer {
                        $out = $wgParser->parse( $text, $this->parserTitle, $this->parserOptions, $lineStart );
                        $html = $out->getText( [
                                'enableSectionEditLinks' => false,
+                               'unwrap' => true,
                        ] );
                } catch ( MediaWiki\Services\ServiceDisabledException $e ) {
                        $html = '<!--DB access attempted during parse-->  ' . htmlspecialchars( $text );
-
-                       if ( !empty( $this->debug ) ) {
-                               $html .= "<!--\n" . $e->getTraceAsString() . "\n-->";
-                       }
                }
 
                return $html;
@@ -862,9 +856,6 @@ abstract class Installer {
                $caches = [];
                foreach ( $this->objectCaches as $name => $function ) {
                        if ( function_exists( $function ) ) {
-                               if ( $name == 'xcache' && !wfIniGetBool( 'xcache.var_size' ) ) {
-                                       continue;
-                               }
                                $caches[$name] = true;
                        }
                }
@@ -1682,7 +1673,7 @@ abstract class Installer {
                // implementation that won't stomp on PHP's cookies.
                $GLOBALS['wgSessionProviders'] = [
                        [
-                               'class' => 'InstallerSessionProvider',
+                               'class' => InstallerSessionProvider::class,
                                'args' => [ [
                                        'priority' => 1,
                                ] ]